Finally came to the remote management of this piece, the show is just beginning ah ~ Here we can easily understand the remote as GitHub.
7. Associated remote Warehouses
First of all, you have to register a GitHub account, and then create a new repository so that I don't have to say much. The following questions revolve around how to connect the local repository to the newly created warehouse on GitHub for easy push and pull.
Next, you want to see a link: https://help.github.com/articles/generating-ssh-keys/The title is easy to understand, right? Just do it.
The next step is the key, which connects the local repository to the remote repository:
git remote add [shortname] [url]
ShortName is a remote repository alias, code, not necessarily the name on GitHub, if the name on GitHub is very long, a short shortname can save a lot of things. And the URL is the corresponding remote warehouse address, but the address of the writing is very fastidious, see here:
https://help.github.com/articles/changing-a-remote-s-url/
Anyway, I wrote it so directly:
git remote add record [email protected]:shuai-meng/time_record.git
Then can be various push and pull, here must pay attention to the beginning of the URL: ([email protected]:), a word can not be wrong ...
Once added, you can use Git remote-v to view all remote repositories:
(Currently I only have a remote repository associated with it)
8. Pull or push updates from a remote repository
(1) Push: git push local branch: remote Branch
(2) Fetch: GIT pull remote branch: local branch
This is the two most basic usage, further usage please move to this point: http://blog.csdn.net/u012668018/article/details/24455687
(3) The remote repository has a default branch, but can be modified, only on the page to modify, the method is: Click on the warehouse name, click Settings, then you can see the default branch, choose the one you want.
Write so much for the time being.
A little summary of Git and GitHub (iii)