在主题分支中查看某人的代码时,我想快速查看开发人员完成的工作: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)git diff mybranch..ce67c59~1
逐页查看diff ,它很好地列出了开发人员对其前叉基础所做的更改。
是否有可以执行第1步和第2步的git命令?
你在追赶git merge-base
。
git diff `git merge-base topic master`..topic
(编辑:git对此有简写:
git diff master...topic
展示自从其主题发展史以来与主题相关的累积变化,以及
git diff topic...master
以显示分支另一侧的差异。)
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句