Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit / JGit » Checking out commit
Checking out commit [message #1423052] Sat, 13 September 2014 21:09 Go to next message
Dario Panada is currently offline Dario PanadaFriend
Messages: 1
Registered: September 2014
Junior Member
Hi,

I have a series of directories, each of which contain the same Git project (In this case asynchttpclient) as cloned from GitHub.

I also have a series of commit hashes.

I want to match each has to a directory, and check out that directory according to the hash.

Ie:

Hashes:

1e9ae842ca94f326215358917c620ac407323c81

368fb5753715f88d78e5c347d2fc8a9f1b2b0bb7

And directories:

A, B

I want the project in A to be checked out on the first hash, and the one in B to be checked out to the second hash. I am using the jGit library. Any ideas on how I could do it?

Thanks! Very Happy
Re: Checking out commit [message #1423924 is a reply to message #1423052] Mon, 15 September 2014 07:19 Go to previous message
Christian Halstrick is currently offline Christian HalstrickFriend
Messages: 274
Registered: July 2009
Senior Member
Something like:

  Git.open(new File(path-of-A)).checkout().setStartPoint(hash1-as-string).call();
  Git.open(new File(path-of-B)).checkout().setStartPoint(hash2-as-string).call();


Ciao
Chris
Previous Topic:Escape file name
Next Topic:gitignore and importing projects
Goto Forum:
  


Current Time: Thu Apr 25 13:28:22 GMT 2024

Powered by FUDForum. Page generated in 0.03408 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top