I need to clone a private repository in github to my remote server in centOS. How could I can achieve this?
Here are the steps to clone a private repository from GitHub to your remote server running CentOS:
ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
Replace "your_email@example.com" with your email address. When asked to “Enter a file in which to save the key,” press Enter to accept the default location.
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_rsa
Add the new SSH key to your GitHub account:
cat ~/.ssh/id_rsa.pubClone the repository: Now you can clone your private repository using the SSH URL:
git clone git@github.com:username/repo.git
Replace username with your GitHub username and repo with the name of your repository.
Remember, these commands are run on your CentOS server. If you’re not currently logged into your server, you can use ssh to log in.
Please replace all instances of your_email@example.com, username, and repo with your actual email, username, and repository name respectively.