How to link to specific line number on github

后端 未结 7 713
滥情空心
滥情空心 2020-11-28 00:57

I know I can link to a specific line number on a file on a github repo (I\'m sure I\'ve seen this before)...

Can someone tell me how to do this?

7条回答
  •  悲哀的现实
    2020-11-28 01:04

    For a line in a pull request.

    https://github.com/foo/bar/pull/90/files#diff-ce6bf647d5a531e54ef0502c7fe799deR27
    
    https://github.com/foo/bar/pull/
    90 <- PR number
    /files#diff-
    ce6bf647d5a531e54ef0502c7fe799de <- MD5 has of file name from repo root
    R <- Which side of the diff to reference (merge-base or head). Can be L or R.
    27 <- Line number
    

    This will take you to a line as long as L and R are correct. I am not sure if there is a way to visit L OR R. I.e If the PR adds a line you must use R. If it removes a line you must use L.

    From: Generate line pointer URL into Github Pull Request

提交回复
热议问题