跳转至

Git merge 合并分支


2016-11-08 by dongnan

目标

test1 分支合并到 master 分支。

步骤

当前分支

git branch -l
master
* test1

合并分支

切换到 master 分支

git checkout master
切换到分支 'master'
您的分支与上游分支 'origin/master' 一致。

合并 test1 分支

# 注意,弹出的文本用于添加备注,添加完保存即可
# 示例中 提示从test1 分支 添加了一个文件 "abc"

git merge --no-ff test1
Merge made by the 'recursive' strategy.
abc | 0
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 abc

验证

git branch -l
* master
test1

帮助

git merge --help

NAME
       git-merge - Join two or more development histories together

       --no-ff
           Create a merge commit even when the merge resolves as a fast-forward. 
           This is the default behaviour when merging an annotated (and  possibly signed) tag.

欢迎关注微信公众号: 运维录

Back to top