45

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?

1

6 Answers 6

53

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

Source

Sign up to request clarification or add additional context in comments.

1 Comment

Will this only affect what you see on the webpage or will it also affect what you download, for example if you clone the repository or choose "Download ZIP"?
18

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.

Comments

10

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

Comments

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

Comments

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

Comments

1

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

Replace the capitalised elements with details for your case

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.