Is there a quick way to “git diff” from the point or branch origin?

后端 未结 7 1195
北恋
北恋 2020-12-23 11:21

I have looked at various SO answers on using git diff and git revisions (HEAD, ORIG_HEAD, FETCH_HEAD, etc.) and I still haven\'t found an easy way to list the c

7条回答
  •  一向
    一向 (楼主)
    2020-12-23 11:49

    Use git diff @{u}...HEAD, with three dots.

    With two dots, or with HEAD omitted, it will show diffs from changes on both sides.

    With three dots, it will only show diffs from changes on your side.

    Edit: for people with slightly different needs, you might be interested in git merge-base (note that it has plenty more options than the other answer uses).

提交回复
热议问题