Git installation basic configuration

Git is a must-use tool software in development. Here are a few configurations necessary for downloading the machine

  1. Configure User Identity
    git config –global user.name “Your Name”
    git config –global user.email “[email protected]
    
    // 例如:
    git config –global user.name “xiaowag”
    git config –global user.email “小王@qq.com”
    
    
    
    
    // 可通过命令查看你的配置项
    git config -list
  2. Generating the secret key y
    Generally speaking, the remote warehouse of the company may require configuring the secret key. Before generating the secret key, you can check whether the local machine already has the secret key
    in the user's home directory (for example: C:\Users\Administrator\. ssh) to see if there is a .ssh directory. If there is, then check if there are two files id_rsa and id_rsa.pub in this directory. If there are already, then there is no need to generate a secret key. If not, You can use the following command to generate the secret key on your local machine now
    ssh-keygen -t rsa -C “[email protected]” // 后面是自己的邮箱

            Then press Enter all the way three times in a row to use the default value. After that, you will definitely have a .ssh directory on your machine. There are two files id_rsa and id_rsa.pub in it. These two are the secret key pair of SSH Key. id_rsa is the private key and cannot be leaked out. key, you can tell anyone with confidence.

              Finally, log in to GitHub, copy the content of the id_rsa.pub file, and set the secret key

               In this way, the most basic configuration of git installation is OK, and you can pull the code to push the code

Note: If you can’t find the folder after the generation, you can go back and see when the key is generated, the command line will prompt:

 

 

Guess you like

Origin blog.csdn.net/fsfsdgsdg/article/details/131648358