How to Link to Lines of Code in a Github Repository!

Posted on December 19, 2017


This'll be a real short one; I just learned you can link to specific lines of code on GitHub!

All you need to do is find your link to the source code preview (***NOTE: not the raw view!) as an example, let's look at a source file from Bitcoin repository*:

Let's say I want to highlight line 123. All you have to do is add a '#L' and the line number you want, so let's add #L123:

Go on. Give it a click. You know you want to! You'll see your browser jumps down and highlights that line.

* main.cpp doesn't exist anymore in the current codebase; it has been reorganized into various other parts of the code, but as an example main.cpp is an attractive file name 😊.

Next / Previous Post:

Or find more posts by tag:

-~{/* */}~-