[英]Link to a specific (current) revision on GitHub
Here is a sample project on github: http://github.com/ripper234/Test-grails-project这是 github 上的一个示例项目: http : //github.com/ripper234/Test-grails-project
I would like to capture the latest revision, and send a link to it to someone, so that even if the project changes later he will see the specific revision I was talking about.我想捕获最新的修订版本,并将其链接发送给某人,这样即使项目稍后更改,他也能看到我正在谈论的特定修订版本。 I guess forking could do that, but it's overkill.我想分叉可以做到这一点,但它是矫枉过正。
How do I do that?我该怎么做?
To access a single file or directory:要访问单个文件或目录:
let's say you would like that the someone you send this link假设您希望发送此链接的人
has to work on the resulting code of this commit.必须处理此提交的结果代码。
he would do this:他会这样做:
now the user has a branch with the code of the mentioned commit.现在用户有一个包含上述提交代码的分支。
does this answer your question?这能回答你的问题吗? -> not sure if I understood it right... -> 不知道我理解对不对...
as mentioned in other answer - for latest commit y
is the shortcut如其他答案中所述 - 对于最新提交y
是快捷方式
for any commit对于任何提交
click on commits
点击commits
and then click on code
icon ( octicon-code )然后点击code
图标( octicon-code )
To show the state of the project at a specific commit:要在特定提交时显示项目的状态:
https://github.com/
<user> /
<project> /tree/
<commit-hash> https://github.com/
<user> /
<project> /tree/
<commit-hash>
For example:例如:
https://github.com/toraritte/software-licensing-a-primer/tree/9f122e02949f966445ad37b1541b70114c9dd602 https://github.com/toraritte/software-licensing-a-primer/tree/9f122e02949f966445ad37b1541b70114c9dd602
or with shortened hash from git log
或使用来自git log
缩短哈希
https://github.com/toraritte/software-licensing-a-primer/tree/9f122e0 https://github.com/toraritte/software-licensing-a-primer/tree/9f122e0
The easiest way without editing the URL is:不编辑 URL 的最简单方法是:
- Choose a commit (either the latest or from the list of commits)选择一个提交(最新的或从提交列表中选择)
- Select "Browse files"选择“浏览文件”
The URL format is as follows: https://github.com/USERNAME/REPO/blob/COMMITID/FILENAME URL格式如下: https : //github.com/USERNAME/REPO/blob/COMMITID/FILENAME
Replace the capitalised elements with details for your case用您的案例的详细信息替换大写元素
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.