Thread (3 messages) flat view 3 messages, 2 authors, 2016-06-15

Re: JGIT newbie question

From: Shawn Pearce <hidden>
Date: 2016-06-15 22:50:22

On Tue, Jan 11, 2011 at 10:51, sundarbun [off-list ref] wrote:
I am looking into using JGit from Java
JGit related questions are probably better directed to the
jgit-dev@eclipse.org 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.
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.
(a) get a bunch of files from my remote repo
Try the checkout() method on the Git object.
(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).

-- 
Shawn.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help