In github, you can comment on lines in a commit. Is there a way to comment on a line, while viewing a file in a branch, without having a particular commit?
On the pull request, click Files changed. Hover over the line of code where you'd like to add a comment, and click the blue comment icon. To add a comment on multiple lines, click and drag to select the range of lines, then click the blue comment icon. When you're done, click Add single comment.
To add review comments, click the + icon next to the line number. Type your review comment and then click Start Review. When you are finished adding review comments, from the Side Bar you can choose to either submit the comments, approve the changes, or request changes.
You can link to a specific line in the Markdown file the same way you can in code. Append #L with the line number or numbers at the end of the url. For example, github.com/<organization>/<repository>/blob/<branch_name>/README.md?
Unfortunately it is not possible to comment on a line in Github without a commit.
But you can create links to lines in your file (click on line and copy link on browser bar). For example you can use this links in your issues to discuss about code line:
https://github.com/sebastianbergmann/phpunit/blob/master/src/Runner/StandardTestSuiteLoader.php#L72
Update
You can also hold shift to obtain a link to a block of lines
You should have at least one commit: your initial import ;-) So if you never touched the file afterwards, you can still browse your master branch (or wherever you did the initial import to).
To get to a commit of file, do as follows:
You should now be able to comment the file.
This blog post provides a simple way to use github's built-in commenting features for this: http://astrofrog.github.io/blog/2013/04/10/how-to-conduct-a-full-code-review-on-github/
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