查看分支
# git branch
alex
* master
创建分支
# git branch test
# git branch
alex
* master
test
切换分支
# git checkout alex
Switched to branch 'alex'
分支合并
# git merge alex
Updating 1e0b362..22031de
Fast-forward
1.txt | 1 +
3.txt | 3 +++
2 files changed, 4 insertions(+), 0 deletions(-)
create mode 100644 3.txt
具体步骤
vim 1.txt
# git add 1.txt
# git commit -m "alex fenzhi"
[alex 22031de] alex fenzhi
1 files changed, 1 insertions(+), 0 deletions(-)
# git checkout master
Switched to branch 'master'
Your branch is ahead of 'origin/master' by 4 commits.
# git merge alex
Updating 1e0b362..22031de
Fast-forward
1.txt | 1 +
3.txt | 3 +++
2 files changed, 4 insertions(+), 0 deletions(-)
create mode 100644 3.txt
删除分支
# git branch -d test
Deleted branch test (was 1e0b362).