GitHub compare view for current versions of branches

后端 未结 2 535
悲哀的现实
悲哀的现实 2021-02-04 06:22

Is there a way to use GitHub\'s \"compare view\" to view the diff between the current versions of two branches? (That is, to view the same diff that you would get if y

相关标签:
2条回答
  • 2021-02-04 06:36

    GitHub only supports the triple dots (...) range shortcut specification.

    From the git diff documentation:

    git diff [--options] .. [--] […]

    This is synonymous to the previous form. If on one side is omitted, it will have the same effect as using HEAD instead.

    git diff [--options] ... [--] […]

    This form is to view the changes on the branch containing and up to the second , starting at a common ancestor of both . "git diff A...B" is equivalent to "git diff $(git-merge-base A B) B". You can omit any one of , which has the same effect as using HEAD instead.

    0 讨论(0)
  • 2021-02-04 06:42

    GitHub now (Sept. 2018, 4 years later) explicitly supports "Three-dot and two-dot Git diff comparisons".

    The URL https://github.com/github/linguist/compare/c3a414e..faf7c6 will display:

    The message is:

    This is a direct comparison between two commits made in this repository or its related forks
    

    Now you can easily see the differences between two commits without comparing from their common merge base commit like a three dot comparison would.

    0 讨论(0)
提交回复
热议问题