Github upload and download, github upload and download
1. Create an SSH key
When using github for the first time, create an ssh key locally
ssh-keygen -t rsa -C "your_email@youremail.com"
After the your_email@youremail.com is changed to your mailbox, will ask to confirm the path and enter the password, we use the default one-way carriage return on the line.
If it succeeds ~ /, Generate the. ssh folder, go in, open id_rsa.pub, and copy the key.
Go back to github, go to Account Settings, select SSH Keys on the left, Add SSH Key, enter the title, and paste the key. Similar:
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA63rye64sOsj3wINkbDKcnEC78bG/Bg0DBS5Q6TZaEglIHTAhszWu/meFuUiUHGpKSzVc29DHeqaM7Jvad3zhcaceu5Bl1OFT7devC0Q3s5k+MYwdIwc/OiiF9MBia5iXxS6N2i7NSEoXjFiS2EcpXPmhn/pljxCIzOhJy2OB3i6VBJJBFYb2BL03/ozOqnI3hKk3o8hpop28UkzKr4f+ObPZDAyI9riXhbu5nnZDqQSzlwv3NDoZOOWm9t8NcEUIeMSSB5+FGY64CPGE85GUop1+2QcVpRBMd2CU3R4NtFllFYwnf9f3uGoXG6IBPBP2EO3KBGXaHj0v83rpqbt+2w== cdkd321@126.com
In git bash, enter:
ssh -T git@github.com
If this is the first time, a message indicating whether to continue is displayed. Enter yes and you will see:
You’ve successfully authenticated, but GitHub doesnot provide shell access
This indicates that github has been successfully connected.
Upload
//or create a new repository on the command lineecho # command >> README.mdgit initgit add README.mdgit commit -m "first commit"git remote add origin git@github.com:xiabodan/command.gitgit push -u origin master
//or push an existing repository from the command linegit remote add origin git@github.com:xiabodan/command.gitgit push -u origin master
Download
First download
git clone https://github.com/xiabodan/DataStructure.git
Update code
git pull