Directory
Objective
1. General Push and pull
2. Branching operations
Objective
This article summarizes the branch operations of GitHub, based on the following articles:
http://blog.csdn.net/guang11cheng/article/details/37757201 (Create a new branch on GitHub)
Http://www.cnblogs.com/mengdd/p/3447464.html (Managing projects on GitHub)
https://help.github.com/articles/merging-a-pull-request/(Merging a pullrequest)
one or one-like Push and the Pull
Push
git remote add originhttps://github.com/xxx (username)/yyyy (projectname). git
Git push-u Origin Master
Pull
Git pull Origin master//pulling from GitHub to the local source repository
In fact, the pull command is git fetch plus git merge
Git fetch origin
git merge Origin/master
Note:
git merge Brancha Branchb
Branchb generally assume that the current branch
That
git merge Origin/master
Merge the Master branch on origin into the current branch
Second, branch operation
To create a new branch locally:
Git branch Dev
Switch to your new branch:
git checkout Dev
Push Branch
Method 1 :
Git push Origin Dev
Method 2 :
Git push-u origin Local:remote
Like what:
Git push-u origin Master:master
Indicates that the local master branch (before the colon) is push to the master branch of GitHub (after the colon).
Note: If the left side is not empty, the remote right branch will be deleted.
Delete Branch
Git branch//can see all the branches
git branch-d dev//Remove DEVELOP2 Branch
Merging branches
The git merge Master//git Merge command is mentioned in the above (1. General Push and pull)
Remote Side Delete branch:
Git push origin:d Ev
Note: Push The branching method is explained in two
Remote Merge Branch
Merging a pull request (https://help.github.com/articles/merging-a-pull-request/) with page operation method
Command-line method (not feasible after experiment):
1. Use the git checkout command to switch branch to remote branch
2. Merging with git merge
Direct git merge merge, feasibility pending test
The branch operation of GitHub learning experience