GIT is currently a popular open-source code collaboration tool, but it is difficult for beginners to learn how to upload code and download synchronization. There are roughly two solutions. One is to use the git gui that provides the interface. For details about how to operate it, see the following link.
Http://hi.baidu.com/mvp_xuan/item/789262104e758f3bb93180d2
The second method is to use the GIT Batch command line mode. However, how to identify the local branch or the server branch is a bit messy.
To clarify your ideas, click the version library in the git gui-> View the history of all branches in the diagram:
Is the Historical List. The local branch name is "master", and the server branch name is "origin" instead of "master ). Of course, this local name can be changed. Now we know the corresponding relationship, who should push it to or who will pull it.
To push the local code to the server, the local master branch that has been committed is actually pushed to the origin branch of the server. Start GIT Batch in the IDE project and use the git push origin command. The complete command here should be git push master origin, and the local master can be omitted.
To synchronize the server-side code to the local, the essence is to take the origin branch of the server (fetch) and give it to the local code in pull. Therefore, the command first uses git fetch to retrieve the latest code on the server. The complete code is git fetch origin, which is the default and omitted. Then, git pull origin master is synchronized to the local master version.
Another example of the popular GIT commands on the internet is as follows: