* JGIT newbie question
@ 2011-01-11 18:51 sundarbun
2011-01-11 19:30 ` Shawn Pearce
0 siblings, 1 reply; 3+ messages in thread
From: sundarbun @ 2011-01-11 18:51 UTC (permalink / raw)
To: git
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
--
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.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: JGIT newbie question
2011-01-11 18:51 JGIT newbie question sundarbun
@ 2011-01-11 19:30 ` Shawn Pearce
2011-01-11 21:58 ` sundarbun
0 siblings, 1 reply; 3+ messages in thread
From: Shawn Pearce @ 2011-01-11 19:30 UTC (permalink / raw)
To: sundarbun; +Cc: git, jgit-dev
On Tue, Jan 11, 2011 at 10:51, sundarbun <sundarbun@yahoo.com> 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.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: JGIT newbie question
2011-01-11 19:30 ` Shawn Pearce
@ 2011-01-11 21:58 ` sundarbun
0 siblings, 0 replies; 3+ messages in thread
From: sundarbun @ 2011-01-11 21:58 UTC (permalink / raw)
To: git
Thanks Shawn.. I did look at the jGit list and I will post there as well.
>>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
--
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.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2011-01-11 21:59 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-01-11 18:51 JGIT newbie question sundarbun
2011-01-11 19:30 ` Shawn Pearce
2011-01-11 21:58 ` sundarbun
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).