Git SSH Key generation step (detail)

Git is a distributed code management tools, remote code management is based on the SSH, so you need to use a remote Git SSH configuration.

github SSH configuration as follows:

First, set the user name and the email Gi t:

$ git config --global user.name "xuhaiyan"
$ git config --global user.email "[email protected]"

Second, the key generation process SSH:

1. check whether they have been ssh key: cd ~ / .ssh

If no key not have this folder, you have to delete the backup

2. Survival Key:

$ Ssh-keygen -t rsa -C " [email protected]"
Press Enter 3, a blank password.


Your identification has been saved in /home/tekkub/.ssh/id_rsa.
Your public key has been saved in /home/tekkub/.ssh/id_rsa.pub.
The key fingerprint is:
………………

Finally we got the two files: id_rsa and id_rsa.pub

3. Add the key to ssh: ssh-add the file name

You need to enter a password before.

4. Add ssh key on github, which is to be added "id_rsa.pub" inside the public key.

Open link: https://github.com/  , landing: xuhaiyan825, then add ssh.

5. Test: ssh [email protected]

The authenticity of host ‘github.com (207.97.227.239)’ can’t be established.
RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48.
Are you sure you want to continue connecting (yes/no)? yes
Warning: Permanently added ‘github.com,207.97.227.239′ (RSA) to the list of known hosts.
ERROR: Hi tekkub! You’ve successfully authenticated, but GitHub does not provide shell access
Connection to github.com closed.

Third, start using github

1. Get the source:

$ git clone [email protected]:billyanyteen/github-services.git

So your machine will have a repo up.

2. commonly used commands:

git to svn The difference is that git is distributed, no server concept. All of the people's machines have a repo, are each commit to their own machines repo warehouse initialization:

git init

And stores a snapshot item index:

git add

Project Index submit:

git commit

There git rm, git mv and so on ...

3. Collaboration programming:

The local repo to remote repo origin of the merger, push local updates to the remote:

git push origin master

Remote update to update local:

git pull origin master

4. Supplement:

Add distal repo:

$ git remote add upstream git://github.com/pjhyett/github-services.git

Rename distal repo:

$ git://github.com/pjhyett/github-services.git为“upstream”

 

More exciting, please pay attention to my "Today's headlines No": Java cloud notes
anywhere, so you have the latest and most convenient Pocket Cloud Services

 

 

 

 

Published 165 original articles · won praise 270 · views 80000 +

Guess you like

Origin blog.csdn.net/weixin_44259720/article/details/104675384