Link to line in compare view on github

Viewed 1518

Similar to How to link to specific line number on github I'd like to link to a line of code on github. The difference is that I want to link to a line in the diff viewer. See for example this link:

https://github.com/git/git/commit/5bdb7a78adf2a2656a1915e6fa656aecb45c1fc3/#diff-fea9abc098557219301972e6c6782b8fL9

In addition to the commit hash (5bdb7a78...) there is a second hex string in the url anchor (#diff-fea9abc0...) that seems to specify the file being changed.

I'd like to be able to generate these links without first visiting github and clicking on the line. How is the second hex string (#diff-fea9abc0...) generated?

1 Answers
Related