Is it possible, how to show diff between commits in github?

Viewed 1379

A user proposed a localization to an open source project; however, they proposed a localization for an old version. I'd like to point them at the changes that were made between the two.

I know that I can show the difference between branches by providing the following link:

https://github.com/<user or organization>/<project>/master...master:<branch name>

Is there a similar interface for comparing certain commits? (and, ideally, only versions of a certain file) I'd like not to bother the potential contributor with learning git and doing the diff locally in the first place (although that I'll suggest that in the future).

I've tried

https://github.com/<user or organization>/<project>/master...master:<hash>

but that didn't work which is kinda expected; and I haven't found any reference on this matter either.

1 Answers

You can compare the difference between two commits on GitHub by using the below URL

https://github.com/{user}/{repo}/compare/{commit-1-hash}..{commit-2-hash}

For eg, to compare the diff between commits c3a414e and faf7c6f for the linguist repo of github, use the below

https://github.com/github/linguist/compare/c3a414e..faf7c6f

The above will show the diff like this:

enter image description here

You can go through the GitHub reference for more information.

Related