This record is for apple computer users ~~ Windows system friends can refer to ideas, but the command will be different, you need to check the corresponding file address and command ~~

View and modify the current git user and email address

/ / check
git config user.name
git config user.email

/ / modify
git config --global user.name "fengqijie" 
git config --global user.email "[email protected]"
Copy the code

Git views, sets, and cancels proxies

/ / check
git config --global --get http.proxy 
git config --global --get https.proxy

/ / set
git config --global http.proxy socks5:/ / 127.0.0.1:1080
git config --global https.proxy socks5:/ / 127.0.0.1:1080

/ / cancel
git config --global --unset http.proxy 
git config --global --unset https.proxy
Copy the code

Check whether the SSH Key exists

SSH ls or ll or open./// Check whether the id_rsa and id_rsa.pub files exist
Copy the code

If you do not have an SSH Key, you need to authenticate it

// If the contents of id_rsa.pub are not the SSH keys you want, you can delete id_rsa and id_rsa.pub
// Then run the following command to generate a new one
ssh-keygen -t rsa -C "[email protected]"
Copy the code

Run the following command to obtain the SSH Key

cat id_rsa.pub
// Copy the secret key to start with ssh-rsa
Copy the code

Add an SSH Key to GitHub

1. GitHub click on the user’s profile picture and select Setting

Create a new SSH Key (give it a name, copy the secret Key and add it).

3. Check whether the SSH Key is successfully configured

ssh -T [email protected] 
// The result is similar to the following
Hi fengqijie! You've successfully authenticated, but GitHub does not provide shell access.
Copy the code

4. What if you want to use SSH to submit an HTTPS link?

Directly modify the config file in the.git folder of the project directory and change the address.

Git address can be switched as shown below

Reference documentationBlog.csdn.net/u013778905/…