Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Link to a specific (current) revision on GitHub

Tags:

git

github

Here is a sample project on 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?

like image 620
ripper234 Avatar asked Oct 23 '10 16:10

ripper234


People also ask

How do I link to a specific line in GitHub?

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? plain=1#L14 will highlight line 14 in the plain README.md file.

How do I link to an issue in GitHub?

To link related issues in the same repository, you can type # followed by part of the issue title and then clicking the issue that you want to link. To communicate responsibility, you can assign issues. If you find yourself frequently typing the same comment, you can use saved replies.

How do I reference a commit in GitHub?

To reference a commit, simply write its SHA-hash, and it'll automatically get turned into a link.


3 Answers

Just press y and the URL will change automatically to reflect the current version.

Source

like image 53
Anmol Singh Jaggi Avatar answered Oct 14 '22 13:10

Anmol Singh Jaggi


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.
like image 26
Tim Čas Avatar answered Oct 14 '22 13:10

Tim Čas


let's say you would like that the someone you send this link

  • http://github.com/ripper234/Test-grails-project/commit/c3110a562339a20eaa4c99e25d2e92538bd6c23d

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

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...

like image 36
udo Avatar answered Oct 14 '22 11:10

udo