git GitHub 上特定(当前)修订版的链接
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/4004860/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Link to a specific (current) revision on GitHub
提问by ripper234
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?
我怎么做?
采纳答案by Tim ?as
To access a single file or directory:
要访问单个文件或目录:
- While browsing directories: Click on the "latest commit <refid>" link at the top of the file list, and then "Browse code" in the blue area near the top.
- While viewing a file: Click on "History" and then on the "<>" button next to the refid to get a link.
- 浏览目录时:单击文件列表顶部的“最新提交 <refid>”链接,然后单击顶部附近蓝色区域中的“浏览代码”。
- 查看文件时:单击“历史记录”,然后单击 refid 旁边的“<>”按钮以获取链接。
回答by Anmol Singh Jaggi
回答by udo
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:
他会这样做:
- git clone git://github.com/ripper234/Test-grails-project.git
- cd Test-grails-project
- git checkout c3110a562339a20eaa4c99e
- git branch c3110a562339a20eaa4c99e
- git 克隆 git://github.com/ripper234/Test-grails-project.git
- cd 测试-grails-项目
- git 结帐 c3110a562339a20eaa4c99e
- git 分支 c3110a562339a20eaa4c99e
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...
这回答了你的问题了吗?-> 不知道我理解对不对...
回答by bhv
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)
回答by toraritte
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:
例如:
or with shortened hash from
git log
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"
- 选择“浏览文件”