I want to reference certain lines from a file in a GitHub repository in an issue. How can I do this without copying and pasting manually? Can I use a link to the source code?
To clarify, here is the file that I want to reference code from:
mysource.py
1: def func1():
2: for i in range(10);
3: print 'hello world'
4:
5: def func2():
6: for i in range(10);
7: print 'hello world'
I want to quote lines 5 to 7 of the file in my issue like this:
5: def func2():
6: for i in range(10);
7: print 'hello world'
You can now do this by selecting a range of lines and using the create issue menu option:

...resulting in:

... menu on the left, select create an issueThe key is to get a permalink to the code, that will be automatically converted to the code snippet by GitHub Markdown (GFM). After completing the steps below, the whole thing should look like this after you create an issue or comment:

Live example
Follow these steps:


master.If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With