5 ms·
You can link directly to a line by appending #<line_number> https://github.com/torvalds/linux/blob/f4bc5bbb5fef3cf421ba3485d6d383c27ec473ed/kernel/sys.c#L1029
by codingkev 5y ago
You can link directly to a line by appending #<line_number>
https://github.com/torvalds/linux/blob/f4bc5bbb5fef3cf421ba3485d6d383c27ec473ed/kernel/sys.c#L1029 https://github.com/torvalds/linux/blob/f4bc5bbb5fef3cf421ba3...
- umvi 5y agoYou can also change "github.com" to "github1s.com" or "github.dev" if you want to view it in VSCode in browser. i.e. https://github.dev/torvalds/linux/blob/f4bc5bbb5fef3cf421ba3485d6d383c27ec473ed/kernel/sys.c#L1029 https://github.dev/torvalds/linux/blob/f4bc5bbb5fef3cf421ba3... https://github1s.com/torvalds/linux/blob/f4bc5bbb5fef3cf421ba3485d6d383c27ec473ed/kernel/sys.c#L1029 https://github1s.com/torvalds/linux/blob/f4bc5bbb5fef3cf421b...
- thunderbong 5y agoOr just press '.' if you're logged in
- dennis_moore 5y agoI tried that but everything after the # got stripped when I submitted the link.
- pan69 5y agoOr just click on the line number to change the URL to that line.
- gabrielsroka 5y agoAnd shift-click on a second line to select a block.
- whalesalad 5y agoAnother fun github hack: if you browse the repo for a particular file, the URL will be something like github.com/user/repo/blob/master/foo/bar/baz.py But this file can change, meaning this url might not have the same content a week or month down the road. This is particularly troublesome when you have lines selected. To fix this, press `y` and your url will get expanded to include the current commit hash: github.com/user/repo/blob/e4ecae.../foo/bar/baz.py Now your URL is safe to share.