So you want to link to a line or chunk of code this is how you do it.
- Go to the file you are talking about, if you are viewing a number of files click to view the specific file.
- To select one line go to the gutter (where the line numbers are) and click the number, it will highlight in yellow.
- For multiple lines select the starting line as above then select
shift
click
the end line. It will highlight the entire chuck of code. - The URL will have automatically changed if you noticed, but this is not the canonical URL as when commits continue and the line numbers shift do to addition of code, sooner or later the URL will be pointing to something completely different.
- To prevent this hit
Y
and you will get the permanent canonical URL to the commit. - Now the address bar has the permanent link to that chunk/line of code.