git to create a branch
first get a clean copy of the code, such as
$ git clone <...>
View the current code's branching status
$ git Branch
* Master
Where the * number indicates the branch you are currently using to create a branch
$ git Branch release_1.0
In the command above
$ git Branch
* Master
release_1.0
commit This branch to a remote repository
$ GIT push origin release_1.0 total
0 (Delta 0), reused 0 (Delta 0) to
...
* [New branch] release_1.0-> release_1.0
Toggle Branch
$ git checkout release_1.0
Then look at the branching situation, at which point the current work branch becomes release_1.0.
$ git Branch
Master
* release_1.0
If you want to switch back, you can run the following command
$ git checkout master
$ git Branch
* Master
release_1.0
submitting code to a branch
If you are submitting code to a branch, you first need to switch the current work environment to the branch where you want to submit the code, and then use the steps that normally we submit code to submit the code as follows: submit code to master
git checkout master
git add readme.md
git commit-m ' test commit to Master ' readme.md
git push
submitting code to the release_1.0 branch
git checkout release_1.0
git add readme.md
git commit-m ' test commit to release_1.0 branch ' readme.md
git p Ush
Reprint please indicate this link form link
This article link: http://blog.csdn.net/kongxx/article/details/51828837