Git学习笔记Git Branching

1.Branch is just a pointer called HEAD which points to the current snapshot.

2.Create a new branch:git branch [branch-name].

3.Switching to an existing branch:git checkout [new branch].

4.Merge branch: merge a branch to the mater branch, just $git checkout master;$git merge [another branch]. After merge it, you can delete it by $git branch -d [another branch].

5.To see all branch :$git branch; To see branch merged:$git branch --merged; To see branch not merged:$git branch --no-merged;

6.tracking branches are local branches that have a direct relationship to a remote branch. So it will automatically update when you push or pull.

7.You can set up track branch tracking remote branch other than master by: get checkout --track origin/[serverfix].

8.Delete Remote Branches : git push origin   :[serverfix].

9.Delete local branch: git branch -d hotfix.

原文地址:https://www.cnblogs.com/daizuozhuo/p/3052436.html