繁体   English   中英

如何在git分支上查看更改的文件

[英]How to view changed files on git branch

当在主题分支检讨别人的代码,我想很快看到由开发人员所做的工作:一diff什么是对针对其分叉分支改变承诺,但没有检出的分支或比较,以我目前的分支,它可能成为另一个进行中的主题分支或其他。

我通常要做的是获取主题分支,然后:

1)一个git log( git log --decorate --all --oneline --graph )并选择分支上的第一个和最后一个提交,例如:

|  * 88aa417 (mybranch) the last commit in the topic branch
|  * ef16947 xxxxxxxxxxxxxxx
|  * b65ed5f xxxxxxxxxxxxxxxxx
|  * ce67c59 the first commit in the topic branch
| /
|/
* 008483e xxxxxxxxxxxxxxxxx

2)逐页查看diff git diff mybranch..ce67c59~1 ,它很好地列出了开发人员对其前叉基础所做的更改。

是否有可以执行步骤1和2的git命令?

您正在使用git merge-base

git diff `git merge-base topic master`..topic

(编辑: git对此有简写

git diff master...topic

展示自从主题发展史以来与主题相关的累积变化,以及

git diff topic...master

以显示分支另一侧的差异。)

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM