How to select/comment on a range of lines in github pull request?

前端 未结 5 686
隐瞒了意图╮
隐瞒了意图╮ 2020-12-08 18:39

There is an option to comment on a range of lines in file on github, see How to refer to a specific line or range of lines in github?

But is there similar option to

相关标签:
5条回答
  • 2020-12-08 19:09

    To reference multiple lines click on a line number in the diff view, hold shift, and click on a second line number. The URL of the page will update and can be shared with fellow contributors.

    To leave a comment referencing multiple lines click and hold to the right of a line number, drag, and then release the mouse when you’ve reached the desired line.

    0 讨论(0)
  • 2020-12-08 19:11

    Multi-line comments have arrived! Git has introduced new feature today for multiline comment please have look

    By click on + icon and then drag to multiple lines

    https://twitter.com/github/status/1179101186437324801

    0 讨论(0)
  • 2020-12-08 19:12

    The multiline comment feature is now available on GitHub. Enjoy!

    0 讨论(0)
  • 2020-12-08 19:17

    Since Oct. 2019, Nat Friedman (CEO of GitHub) declares that feature available
    (And, see below, since Feb. 2020, multi-lines comment reference is possible)

    0 讨论(0)
  • 2020-12-08 19:18

    It isn't possible to comment on multiple lines in a pull request review at GitHub. I hope they will create a new feature where this is possible.

    But what you can do, there is a little (time consuming) workaround:

    If you go in to the code, in the branch with the changes, you can select multiple lines and then copy a permalink for those lines. When you paste this link into your review comment, it will be shown as a code snippet.

    For more, read this: https://help.github.com/articles/creating-a-permanent-link-to-a-code-snippet/

    Update Github has released a new feature where this is possible. See VonC's answer :-)

    0 讨论(0)
提交回复
热议问题