Installation and configuration of remote Git repository on CentOS

 

After the first landing CentOS server, connect to the server we use the delete command yum remove git Git installed, if not before Git installed you do not need this step. Note that the premise is installed on your CentOS yum server, which is a very high frequency of use CentOS tools, and you can enter y when prompted input.

 

 

Git is ignored in the previous step, use yum install git or yum insall -y git If not installed, add a -y in the installation process after it is fully automated, and no longer have any need for prompt confirmation.

 

After installation is complete, use git --version command to view the version of Git, we can see the following version information, indicating that the installation was successful Git 

 

 

Git remote repository configuration on CentOS

We use Git on CentOS connected Gitee cloud code, first we need to generate the public key on the server, the command line ssh-keygen -t rsa -C "[email protected]", behind "[email protected]" your own email address. After the command is executed, continuously press the Enter key three times to generate a public key and a private key.

 

 Use the command cat ~ / .ssh / id_rsa.pub view the contents of the public key, and copy them, and paste added to the cloud where the public key code, paste point "OK" button, box appears shells need to enter codes Cloud SSH public key will be prompted to add a success after password input.

 

 

 

 

 

 Then back to the CentOS server, enter ssh -T [email protected], return success if the configuration was successful. If not successful, for example, suggesting the need to configure hosts, then we need to use vi / etc / hosts command to edit the hosts file, add 120.55.226.24 gitee.com configuration, as shown below, save and exit after completion of the addition, and re-execute ssh -T [email protected] can be.

 

 

 

 

 

Guess you like

Origin www.cnblogs.com/jasonLiu2018/p/11578665.html