43

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?

David Moles
  • 48,006
  • 27
  • 136
  • 235
ripper234
  • 222,824
  • 274
  • 634
  • 905

6 Answers6

47

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

Source

Anmol Singh Jaggi
  • 8,376
  • 4
  • 36
  • 77
17

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.
Boris Verkhovskiy
  • 14,854
  • 11
  • 100
  • 103
Tim Čas
  • 10,501
  • 3
  • 26
  • 32
6

To show the state of the project at a specific commit:

https://github.com/<user>/<project>/tree/<commit-hash>

For example:


The easiest way without editing the URL is:

  1. Choose a commit (either the latest or from the list of commits)

enter image description here

  1. Select "Browse files"

enter image description here

toraritte
  • 6,300
  • 3
  • 46
  • 67
5

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

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

udo
  • 4,832
  • 4
  • 54
  • 82
2

as mentioned in other answer - for latest commit y is the shortcut


for any commit

click on commits

enter image description here

and then click on code icon (octicon-code)

enter image description here

bhv
  • 5,188
  • 3
  • 35
  • 44
1

The URL format is as follows: https://github.com/USERNAME/REPO/blob/COMMITID/FILENAME

Replace the capitalised elements with details for your case