git diff between working copy and branch base

故事扮演 提交于 2019-12-06 13:27:38

问题


I can compare the tip of master and my working copy with

git diff master

I can compare the tip of the current branch with its merge base from master with

git diff master...

Is the a git diff command to compare the merge base of the current branch and the working copy?


回答1:


Is the are git diff command to compare the merge base of the current branch and the working copy?

If you current branch is not master, you can try in a bash shell:

git diff $(git merge-base --fork-point master)

If uses git merge-base with --fork-point:

git merge-base --fork-point <ref> [<commit>]

Find the point at which a branch (or any history that leads to <commit>) forked from another branch (or any reference) <ref>.
This does not just look for the common ancestor of the two commits, but also takes into account the reflog of <ref> to see if the history leading to <commit> forked from an earlier incarnation of the branch <ref>.



来源:https://stackoverflow.com/questions/39143524/git-diff-between-working-copy-and-branch-base

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!