1. Create SSH key
First time using GitHub, first create the SSH key locally
ssh-keygen-t-C"[email protected]"
The following [email protected] changed to your mailbox, then asked to confirm the path and enter the password, we use the default all the way to the line.
Successful words will be generated under ~/. SSH folder, go in, open id_rsa.pub, copy the key inside.
Go back to GitHub, go to account Settings, choose SSH keys,add ssh key,title on the left, and paste the Key. Similar to:
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA63rye64sOsj3wINkbDKcnEC78bG/Bg0DBS5Q6TZaEglIHTAhszWu/meFuUiUHGpKSzVc29DHeqaM7Jvad3zhcaceu5Bl1OFT7devC0Q3s5k+MYwdIwc/OiiF9MBia5iXxS6N2i7NSEoXjFiS2EcpXPmhn/pljxCIzOhJy2OB3i6VBJJBFYb2BL03/ozOqnI3hKk3o8hpop28UkzKr4f+ObPZDAyI9riXhbu5nnZDqQSzlwv3NDoZOOWm9t8NcEUIeMSSB5+FGY64CPGE85GUop1+2QcVpRBMd2CU3R4NtFllFYwnf9f3uGoXG6IBPBP2EO3KBGXaHj0v83rpqbt+2w== cdkd321@126.com
In order to verify success, enter it under GIT bash:
ssh -T git@github.com
If this is the first time you are prompted for continue, enter Yes to see:
shell
This means that you have successfully connected to GitHub.
Upload
//or create a new Repository on the Span class= "Hljs-title" >command line Echo # command >> readme.md git initgit add Readme.mdgit commit-m "first commit" git remote add origin [Email protected]:xiabodan/command . git Git push-u origin master
//oranfromthecommand lineadd origin [email protected]:xiabodan/command.gitgit push -u origin master
Download
First time Download
clone https://github.com/xiabodan/DataStructure.git
Update code
git pull
GitHub upload and download