如何找出2个远程分支之间的区别?
我试过了:
git diff --name-status remotes/branch-V4.4..remotes/branch-V4.2
但是它给了我一个变化的文件列表。 有没有办法让我得到一个提交列表,向我展示2个分支之间的区别?
谢谢。
更新
谢谢你的回答。我试过'git log --graph remotes / branch-V4.4 ... remotes / branch-V4.2'
我看到了
* commit ............
|
|
|
* commit .............
|
|
|
* commit .............|
|
|
* commit .............
为什么只有“|” ,一条直线?为什么它没有显示2个分支在哪里开始分歧?
谢谢。
答案 0 :(得分:12)
您正在寻找的东西可能是:
gitk --left-right remotes/branch-V4.4...remotes/branch-V4.2
或者如果gitk不可用:
git log --oneline --graph --decorate --left-right --boundary --date-order remotes/branch-V4.4...remotes/branch-V4.2
您可能还想在没有--date-order
的情况下尝试使用它,但特别是在复杂情况下,我发现git log
会生成更多有用的图表。
该图表中的每个提交都会标记为<
,>
或o
- 这意味着它们是左分支,右分支或“边界提交”的一部分”
答案 1 :(得分:4)
使用git log
代替git diff
:
git log remotes/branch-V4.4..remotes/branch-V4.2
答案 2 :(得分:0)
您可以轻松做到。
git diff origin/<remote branch>