This tutorial outlines the steps to clone a private Git repository into a CentOS server.
First, update your package manager and install Git:
sudo yum update
sudo yum install git
If using SSH for authentication, set up SSH keys:
ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
# Follow the prompts
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_rsa
cat ~/.ssh/id_rsa.pub
# Copy the output
Navigate to the desired directory and use the git clone
command:
git clone git@github.com:username/repository.git
# Replace with your repository's SSH URL
For HTTPS, replace the URL accordingly. You might be prompted to enter your credentials if it’s a private repository.
After these steps, you should have the private repository cloned into your CentOS server. You can now navigate to the repository’s directory and start working on it.