Jump to content

Sharing permalinks to line(s) of code on Github using the "y" key shortcut


adrian
 Share

Recommended Posts

Hi everyone,

One thing that I am guilty of (and I am not the only one :)) when sharing links to a line (or lines) of code in a Github repo, is sharing a link to the latest version of the file, rather than a link to a specific blob that won't ever change. In fact there are lots of places in the PW documentation/blog that now have outdated links because of this.

I have known about this shortcut for a while, but keep forgetting it, so hopefully this will engrain it a little better for me.

After you click a line to share (or multiple lines by clicking the first line and then shift+clicking the last line), simply hit the "y" key and the link in the browser address bar will change to one for the current blob, which will always remain correct.

Here's some more info if you are interested: https://blog.mariusschulz.com/2015/07/25/sharing-line-highlights-in-github-files

If you see me (or anyone else) sharing non-permanent links, please remind them of this :)

  • Like 11
Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...