How to compare two different commits on the same branch in github? Ask Question

How to compare two different commits on the same branch in github? Ask Question

Comparing histories on the same branch is very confusing for me on GitHub. I struggle with this regularly:

If I use compare/master in the URL after the GitHub repo name, I can compare against other branches in the repo based on the options in the drop-down menus.

https://help.github.com/en/articles/comparing-commits-across-time

However, I usually want to compare several commits on master.

How is this easily done? Could I get a more clear example?

ベストアンサー1

You can use the following URL structure to compare commits in the same branch:

github.com/<username>/<repo_name>/compare/<commit1>...<commit2>

Replace values for username, repo_name, commit1(old commit) & commit2(new commit) acc. to your project.

The separator between the two commits is ... i.e. 3 dots.

おすすめ記事