[英]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.