Log in

View Full Version : How to Git a specific revision


bnshrdr
21st February 2010, 20:09
For the sake of archiving purposes, I want to go back and compile specific x264 revisions where large changes were made. I was wondering how to use git in order to call for a specific revision.

As it stands now, to get the most up to date revision, you enter:
git clone git://git.videolan.org/x264.git

I have tried so many ways to do this that I am just stumped. Does the git repository even support this?

Thanks for any info!

Dark Shikari
21st February 2010, 20:41
git checkout <revision hash>

bnshrdr
21st February 2010, 20:46
Is there an easy way to find the revision hash for the associated revision? I think I read somewhere it's a sha1 of some type of given string, but in the case of x264, I don't know what is fed into the hash function.

Dark Shikari
21st February 2010, 20:49
Is there an easy way to find the revision hash for the associated revision? I think I read somewhere it's a sha1 of some type of given string, but in the case of x264, I don't know what is fed into the hash function.git checkout master~X checks out the revision X away from master. git checkout master sends you back to the top.

The latest master is r1442.

Do the math ;)

bnshrdr
21st February 2010, 20:58
Sorry for some reason I'm not getting this to work. It's still just grabbing the most recent revision. Here is my command:
git clone git://git.videolan.org/x264.git checkout master~100

Dark Shikari
21st February 2010, 21:04
It's not one command.

bnshrdr
21st February 2010, 21:11
Aha! Thanks. I didn't know to cd into the directory after you git it:
git clone git://git.videolan.org/x264.git
cd x264
git checkout master~X

Thanks again!