赞
踩
有两个分支:master和b1, 其中master分支有master.txt和master-mod.txt两个文件, b1分支有master.txt和b1.txt两个文件
做一下实验:
1. HEAD在master上,执行git merge b1, 结果是master新增了b1.txt文件; 同理,如果HEAD在b1分支上,执行git merge
- MJdeMacBook-Pro:git1 mjli$ git status
- On branch master
- nothing to commit, working tree clean
-
- MJdeMacBook-Pro:git1 mjli$ ll
- total 16
- -rw-r--r-- 1 mjli staff 14 Jan 31 22:35 master-mod.txt
- -rw-r--r-- 1 mjli staff 12 Jan 31 22:32 master.txt
-
- MJdeMacBook-Pro:git1 mjli$ git branch
- b1
- * master
- MJdeMacBook-Pro:git1 mjli$ git merge b1
- Merge made by the 'recursive' strategy.
- b1.txt | 1 +
- 1 file changed, 1 insertion(+)
- create mode 100644 b1.txt
- MJdeMacBook-Pro:git1 mjli$ ll
- total 24
- -rw-r--r-- 1 mjli staff 8 Jan 31 22:37 b1.txt
- -rw-r--r-- 1 mjli staff 14 Jan 31 22:35 master-mod.txt
- -rw-r--r-- 1 mjli staff 12 Jan 31 22:32 master.txt
- MJdeMacBook-Pro:git1 mjli$
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。