1. How to check git configs?

git --version #check git version
git config --global --list # check global setting of git
cat ~/.gitconfig #open global setting file
git config --global --unset user.name #erase global setting of the name
git config --global --unset user.email #erase the global setting of the email

1. What should we write in our git config file?

1.1 How to get token:

click here to get a token

2. How to set up git locally to asynch with github?

Step 1: generate key

ssh-keygen -t rsa -C "<Your email address>"

Step 2: It will create a pub file and put key into it. Please copy it and open github webpage open ssh&gpg keys then click new ssh and paste the key into it.


Step 3: Then add ssh locally by following the commands:

ssh-add ~/.ssh/id_rsa_<part of your file name>

Step 4: Check whether it is successful.

ssh -T git@github.com

Hi yingchaoji! You've successfully authenticated, but GitHub does not provide shell access.

3. How to edit config file to control different ssh?

vim ~/.ssh/config

Execute the following command to see if it is successful.

ssh -T git@tw
ssh -T git@wisers

4. How to log in a specific SSH account and set local setting?

ssh -T git@tw
git config --local user.name "yingchaoji"
git config --local user.email "yingchaoji95@gmail.com"
Last updated: 2024-03-15 13:27:07Git
Author:Chaolocation:https://www.baidu.com/article/17
Comments
Submit
Be the first one to write a comment ~