Installation of git under Linux unubtu

Some people who write code will use the Linux system, and sometimes need to install git to upload the code to the code cloud, now let's summarize the installation and use of git

 

1. First, confirm whether your system has git installed. You can gitcheck it through the command. If not, enter the command in the command line mode sudo apt-get install gitto install it. The picture below shows that after entering git, if the picture below shows that git has been installed, otherwise it is not installed.

 


ungainly
 the picture is a reference, but the effect is the same on all computers

 When git is installed on the computer, we will go to open source China to register an account. After performing the following operations, there will be a user name and email address.

 

2. After the installation is complete, perform git configuration, enter instructions git config --global user.name "xxx"and git config --global user.eamil "你的邮箱地址"

 

 

3. After the configuration is completed, the public key for verification needs to be created. Because the resource library gitis accessed through sshthe method, the file for verification needs to be created locally. Use the command ssh-keygen -C 'you email [email protected]' -t rsa(note that sshthere -keygenis no space between and), the ~/.ssh/corresponding key file will be created in the user directory.

 



 

4. After creating the public key, you need to upload it. Use the command cd ~/.sshto go into the ~/.sshfolder, enter gedit id_rsa.pubopen id_rsa.pubfile, copy everything inside. Then visit the http://git.oschina.net/profile webpage, click SSH公钥, you can enter the title bar at will, and the public key bar will paste the content you just copied into it and it will be OK

 



 

5. You can use the ssh -T [email protected] command to test whether the connection is smooth



 

When the content of the above figure is displayed, it means that the connection is successful, and we can upload the file. We write the steps for uploading the code, which will be given later.

 

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326027604&siteId=291194637