Http://blog.rexzhao.com/2011/11/22/git-branch.html
Git is a distributed system, but git usually sets up a central server when working in a group. Everyone pushes/pull to this server.Code.
Sometimes you need to leave the main line (master) for some testing or debugging work, or want to divide the code into the development version, stable version, etc., at this time you need to do branch.
In the structure of the central server, all remote terminals are the central server, so the configuration method is (taking the dev branch as an example ):
- Login Server
- Execute git branch Dev to create the dev Branch
- Execute git pull locally for updates, and then git checkout Dev can switch to the dev branch.
In addition,When git pushes the origin, it will push all the branches of the origin.(If there is only one remote end, remote can be left empty, so the command is GIT push in general ),If you only want to push a branch of your own, use git push-F-v-N origin Dev.
Google Code: Why 'Everything up-to-date' when pushing (GIT)
Get the project on Google Code for the first time. After registration, try to add a new file to test whether git works well. The result is "Every up-to-date" displayed during the push operation. when checking the file, it is found that none of the files are actually updated. Because I am not familiar with git, I Have To Googling.
After searching, find the cause as follows:
Why does git refuse to push, saying "everything up to date "?
Git push with no additional arguments only pushes branches that exist in the remote already. if the remote repository is empty, nothing will be pushed. in this case, explicitly specify a branch to push, e.g. git push master.
That is to say, the GIT server repository is completely empty at the beginning and does not contain any branch. Therefore, you need to specify one when you start pushing.
After running git remote-V, you can see that your remote end name is origin:
$ Git remote-V
Origin https://code.google.com/p/micolog2 (FETCH)
Origin https://code.google.com/p/micolog2 (push)
After running git branch, you can see that the current branch you are using is the master:
$ Git Branch
* Master
Therefore, after the local commit, run
Git push origin master
You can.