Git configures multiple user mailboxes and is used in Sourcetree

Currently I use Gitee, but I also visit GitHub frequently to learn how to write code and learn new knowledge. I used to have a GitHub account, but I have never built a warehouse or submitted a code. I usually fork, star and Download the most. Today, I registered a GitHub account with a new email and configured Git, which is also a small step. Key points are recorded as follows.

Outline:

  1. Set up a Github account
  2. Generate a new SSH key
  3. Sourcetree Local Settings mailbox
  4. Github new repository, Sourcetree clone, modify commit
  5. SSL_read: Connection was reset, errno 10054 OpenSSL SSL_read: Connection was reset, errno 10054
  6. Note: Sometimes GitHub opens slowly in the above steps, which needs to be solved scientifically.

Sign up for a GitHub account

Sign up at GitHub via email.

Generate a new SSH key

SSH keys provide a way to communicate with GitHub. In this way, GitHub can be used as a remote server for version control without entering a password.

At that time, it was for the convenience of all users to use the same SSH key. Now the requirement is that new GitHub accounts also need to generate a separate SSH key. Note that the registered email address of GitHub and the email address used for submission do not have to be the same, because MY previous email is tied to GitHub, and GitHub will report an error if I use the original SSH, so I use the registered email address as the submission email. After verifying the token in the following steps, you will see that both GitHub submission mailboxes are deliverable. The local setting of the warehouse is set to facilitate differentiation. The steps are as follows:

See the blog how to generate SSH keys,

  1. Go to the C:\Users\[username]\. SSH directory. If you do not have. SSH, you need to check “hidden project” and “file extension” in the upper view.

  2. Enter ssh-keygen -t rsa -c “[email protected]” in CMD. Enter; To enter a new SSH file name, type RSB enter. You can skip this step and enter passphrase twice to generate a new SSH.



  1. Copy the characters in id_rsb.pub to GitHub’s SSH key.

Sourcetree added email

GitHub login window Logon failed, tools => Options => Verify => Add => GitHub HTTPS OAuth Refresh token, verify email account.

Github new repository, Sourcetree clone

Git user information configuration has three levels: system(system level), global(user level) and local(version library). There is only one system configuration for system, one global configuration for each account, and one local configuration for Git version libraries. According to the Git official website, these three levels are covered layer by layer. First look for the System configuration, then look for the global configuration, and finally look for the local configuration. If a configuration value is found during the layer-by-layer search, the configuration of the previous layer is overwritten. If user information is configured for all three levels, the last configuration to take effect is local. The repository sets its own submission mailbox with the highest priority, set in Sourcetree as follows:

Test Sourcetree pull/push/clone

SSL_read: Connection was reset, errno 10054 OpenSSL SSL_read: Connection was reset, errno 10054

Open CMD, cancel the proxy,

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

Change network authentication Settings,

git config --global http.sslVerify "false"
Copy the code

Increase the buffer to 500M,

git config --global http.postBuffer 524288000
Copy the code

GitHub access, clone, push very unstable, often reported this error, even science online is the same, have to wait patiently, repeated attempts.

Finally, you can have fun using GitHub version control to write code like those who conscientiously summarize their experience, selflessly share their knowledge, and contribute to open source projects every day!