使用".."指定git提交范围与"..."指定git提交范围的区别
来源:互联网 发布:北大青鸟主机报警编程 编辑:程序博客网 时间:2024/06/05 18:13
使用".."(两个点)和"..."(三个点)都可以指定一段git提交范围,它们有什么区别呢?
1.如果是在git log命令中
man git-rev-list可以知道它们的区别。
“r1..r2" 与 "^r1 r2"表示的范围一样,都是可以到达r2但不可以到达r1的所有提交。
如下图的提交历史:
git log F..J 将显示C, G, H, I, J
git log J..F 将显示D, E, F
git log F..M 将显示K, L, M
git log M..F 将显示B, D, E, F
D---E-------F / B---C---G---H---I---J / A-------K---------------L--M
“r1...r2"叫做”symmetric difference“,它与 "r1 r2 --not $(git merge-base --all r1 r2)"表示的范围一样,都是表示可以到r1或者r1,但是不能同时达到两者的提交。
“r1...r2" 与 “r2...r1"表示的是一样的。
还是如上图的git提交历史:
git log F...J 将显示D, E, F, C, G, H, I, J
git log F...M 将显示B, D, E, F, K, L, M
2. 如果是在git diff命令中
参考man git-diff的说明。"r1..r2"表示r1到r2之间的区别,而"r1...r2"表示从r1和r2公共祖先到r2的区别。
git diff [--options] <commit> <commit> [--] [<path>...] This is to view the changes between two arbitrary <commit>. git diff [--options] <commit>..<commit> [--] [<path>...] This is synonymous to the previous form. If <commit> on one side is omitted, it will have the same effect as using HEAD instead. git diff [--options] <commit>...<commit> [--] [<path>...] This form is to view the changes on the branch containing and up to the second <commit>, starting at a common ancestor of both <commit>. "git diff A...B" is equivalent to "git diff $(git-merge-base A B) B". You can omit any one of <commit>, which has the same effect as using HEAD instead. $ git diff topic master (1) $ git diff topic..master (2) $ git diff topic...master (3) 1. Changes between the tips of the topic and the master branches. 2. Same as above. 3. Changes that occurred on the master branch since when the topic branch was started off it.
- 使用".."指定git提交范围与"..."指定git提交范围的区别
- git 删除某次指定的提交
- GIT 删除指定COMMIT提交
- 【git】Git检出某次提交指定版本
- git指定提交版本克隆大型库
- git 如何添加指定的文件提交.
- git 合并某个提交commit到指定的分支上
- 使用git命令修改指定的commit提交记录并提交到远程服务器的方法
- git之-git钩子搭建,同步提交到指定目录
- git学习------>如何用git log命令来查看某个指定文件的提交历史记录
- 取指定范围的随机数
- 生成指定范围的随机数
- 生成指定范围的随机数
- 生成指定范围的随机数
- 得到指定范围的随机数
- 生成指定范围的随机数
- 提取指定范围的字符串
- 产生指定范围的整数
- 关于SQL2005的各种心酸
- eclipse集成hadoop
- ERROR: Unable to create the home directory: Operation not applicable
- 中断处理
- 网站常用幻灯片代码
- 使用".."指定git提交范围与"..."指定git提交范围的区别
- sga手动改自动,以及参数文件管理
- leetcode代码分类汇总之-链表
- 执行进程间切换
- 如何判断可执行程序exe及动态链接库dll是合法的可执行程序,及其是32位还是64位?
- hdu 3485
- [算法导论]动态规划---最长公共最序列问题
- PHP经验集锦
- C语言中的指针数组