JGIT newbie question
Hi All:
I am looking into using JGit from Java to get some files from source control for an application that runs on AWS.
We currently use SVNKit and it seems to work fine. We recently made the switch to git and I am having a hard time finding a sample that allows one to
(a) init or create a ocal repo with my credentials and path to the tree that I am interested in...
(a) get a bunch of files from my remote repo
(b) commit any changes back in...
I have searched through this list and have not had any luck.
If there is someone out there that can help me that would be much appreciated.
thanks!
Sundarbun
Signature · 2 lines
View this message in context: http://git.661346.n2.nabble.com/JGIT-newbie-question-tp5911913p5911913.html Sent from the git mailing list archive at Nabble.com.
Quoted 1 line · sundarbun
I am looking into using JGit from Java
JGit related questions are probably better directed to the [email protected] mailing list, as that is the list most of the JGit contributors monitor and answer questions on. The project is hosted at http://www.eclipse.org/jgit/ so you may find more resources there too, including the latest 0.10.1 release.
Quoted 7 lines
to get some files from source control
for an application that runs on AWS.
We currently use SVNKit and it seems to work fine. We recently made the switch to git and I am having a hard time finding a sample that allows one to
(a) init or create a ocal repo with my credentials and path to the tree that I am interested in...
Use the Git object in the org.eclipse.jgit.api package. There is an init method that can create a new repository at the given directory.
Quoted 1 line
(a) get a bunch of files from my remote repo
Try the checkout() method on the Git object.
Quoted 1 line
(b) commit any changes back in...
Try the commit() method on the Git object.
But if you want to avoid using the working directory, you'll need to go through a much lower-level API, setting up your own DirCache, and using an ObjectReader and ObjectInserter to interact with the Repository class. Doing this requires some knowledge of the basic Git data model (commits, trees, blobs).
Signature · 1 line
Shawn.
Thanks Shawn.. I did look at the jGit list and I will post there as well.
Quoted 1 line
Quoted 1 line
But if you want to avoid using the working directory
Not sure what this means.. perhaps I have to read up some more...
I got as far as what you have suggested with the Git object in the org.eclipse.jgit.api jar.
Where I got stumped was the specification of the userid/pwd/repo path parameters that tells git when I init it (as I run on an aws machine with no .git directory initially) to setup shop in a temp working directory that I specify in the init.
I was hoping to have an init command that I could pass a valid git repo url, a user name and pwd and local fileDir so that a .git would be created and then I can call checkout to get the part of the tree that I am interested in.
If you have any insight.. I'd appreciate your comments.
thanks again.
S
Signature · 2 lines
View this message in context: http://git.661346.n2.nabble.com/JGIT-newbie-question-tp5911913p5912619.html Sent from the git mailing list archive at Nabble.com.