When answering questions on Stack Overflow or GitHub itself, I often have this process:
- Browse code in GitHub UI
- Go to relevant file
- Find relevant line
- Click the margin of that line to get the URL to that specific line
The result: a link to e.g.
My intended result is to get a link to that line with a URL that points to the specific commit I'm viewing, because I want my link to be 'stable': if you click it one year from now I want to be reasonably sure it'll show the same code.
Is there a nice way to do this in the UI? Currently my process is a bit hacky:
- Scroll to the top of the file again
- CTRL + click on the short hash top right of the file pane
- Copy the full hash from the URL bar
- Close the tab
- Replace "master" with the copied hash
- Hit enter to verify you go to the right line in that specific commit
- Copy the current URL
I feel like I'm missing some kind of navigation feature to do this?