Local and remote connections using Git GitHub

Many online github process was chaotic, try it yourself sorted out, the main step is more clear, if there are any ambiguities can search for a more detailed comparison

1. Application and disposed github

https://github.com/
this process, please reference the

2. gitbash set the user name and mailbox

Open gitbash, enter the command to set the user name and mailbox
$ git config --global user.name "your name"
$ git config --global user.email "your Email"

3. Generate configuration ssh

Ssh key generated by the mailbox name, address fire prompted for a save key, according to the address specified file structure of your own, after you enter the first line of command
$ SSH-keygen -t rsa -C "[email protected]"
Generating public / . Private Key pair rsa
the Enter the Save to File in Which at The Key (/c/Users/kf/.ssh/id_rsa): D: / SSH / GitHub
the Enter passphrase (empty for NO passphrase):
the Enter passphrase Same, Again:
Your Identification has saved in D been: / SSH / GitHub.
Your public Key has been saved in D: /ssh/github.pub.
at The Key Fingerprint IS:
SHA256: 8J70WllHBwvnolh + LVG2pIOMKRkhzJibLjyoiZNBXvA
[email protected]
at The Key's randomart Image IS:
+ - - [the RSA 2048] ---- +
| = O * |...
| .o O + O + O |..
| OO + + O = = |.
| .oE + + * |..
| =. . S o + o |
| ++. oo + o |
| o =. o + |
| * O |
| . . |
+ ---- [SHA256] ----- +

4. Configuration github ssh

After the successful implementation of the next generation directory will generate two files, one private and one public, find .pub suffix is ​​the public key file, copy the entire contents of the file to github, the specific method is in github page in Settings> SSH and GPG keys> New SSH key set, title content arbitrarily set.

5. Configure the local ssh

Execute ssh-add -l to view the configuration of the local ssh
$ ssh-add -l

If the return follows, then the configuration is correct
2048 SHA256: 8J70WllHBwvnolh + LVG2pIOMKRkhzJibLjyoiZNBXvA / d / ssh / github (RSA)

If the returned word below, indicating that no onset
Could not open a connection to your authentication agent.

You need to perform the following statement:
$ SSH-Agent the bash
$ SSH-the Add / D / SSH / GitHub

6. Verify the connection

After successful authentication ssh configuration is able to connect properly github
$ ssh -T [email protected]
Hi xxx!'ve successfully the Authenticated by You, But does not the Provide shell Access GitHub.

7. synchronized with github

Local projects will be uploaded to GitHub
$ git the Add Remote [email protected] Origin: your_project.git 
$ -u git the Push Origin Master

If not available locally then be downloaded to the local resynchronization
$ git clone your_project.git 
$ -u git the Push Origin Master

Guess you like

Origin www.linuxidc.com/Linux/2019-07/159631.htm