Platform: Win7;github local directory in C:\Users\ZY\Documents\GitHub.
1. Add Ssh-key to the GitHub server:
A), generate Ssh-key:c:\users\zy\documents\GitHub> ssh-keygen-t rsa-c "You-name". all the way to the return, it will be generated under the local C:\Users\ZY\ . SSH
Folder. The contents of the file id_rsa.pub are what we need. The good copy method is (the bad copy here will cause SSH authentication to fail):c:\users\zy\.ssh> the contents of Cat. \id_rsa.pub and then copy it on the command line.
b) Copy the key of the appeal copy to the GitHub server: The image is not copied here ...
c), complete the appeal step after the test SSH is able to pass: C:\Users\ZY\Documents\GitHub> ssh-t [email protected], if the display welcome * * * indicates success.
2, on GitHub to create a local need to synchronize the warehouse: Here also do not copy pictures ...
3, pull the readme.md on the server to the local warehouse (this is important, there is no successful synchronization):
C:\Users\ZY\Documents\github\you-repositories> git Remote add origin [email protected]: You-name/you-repositories.git
C:\Users\ZY\Documents\GitHub\you-repositories> git pull Origin master
If the readme.md file is generated under the local warehouse, this step is successful.
4. Push local content to GitHub server: C:\Users\ZY\Documents\you-repositories> git push-u Origin Master
Go to GitHub to see if the contents of the local repository have been synchronized successfully. If so, it shows that this step was successful.
Yes, you can have a remote GitHub repository in just four steps, which is a good way to manage code for people with neat illness.
Ultra-simple synchronization of local git repositories to remote servers