{"thread":{"id":"26262","subject":"JGIT newbie question","startedAt":"2011-01-11T18:51:50Z","lastAt":"2011-01-11T21:58:58Z","messageCount":3,"participants":["sundarbun","Shawn Pearce"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"159364","messageId":"1294771910028-5911913.post@n2.nabble.com","threadId":"26262","inReplyTo":null,"subject":"JGIT newbie question","fromName":"sundarbun","fromEmail":"sundarbun@yahoo.com","sentAt":"2011-01-11T18:51:50Z","receivedAt":"2011-01-11T18:51:50Z","isPatch":false,"sender":{"key":"sundarbun@yahoo.com","avatar":null},"body":"\nHi All:\nI am looking into using JGit from Java to get some files from source control\nfor an application that runs on AWS.\nWe currently use SVNKit and it seems to work fine. We recently made the\nswitch to git and I am having a hard time finding a sample that allows one\nto \n(a) init or create a ocal repo with my credentials and path to the tree that\nI am interested in...\n(a) get a bunch of files from my remote repo \n(b) commit any changes back in...\n\n\nI have searched through this list and have not had any luck.\n\nIf there is someone out there that can help me that would be much\nappreciated.\n\nthanks!\nSundarbun\n\n-- \nView this message in context: http://git.661346.n2.nabble.com/JGIT-newbie-question-tp5911913p5911913.html\nSent from the git mailing list archive at Nabble.com.\n"},{"id":"159370","messageId":"AANLkTin=bZAgYeKHN2NUjYjZU5NBC_bs3bpCNNhijppq@mail.gmail.com","threadId":"26262","inReplyTo":"1294771910028-5911913.post@n2.nabble.com","subject":"Re: JGIT newbie question","fromName":"Shawn Pearce","fromEmail":"spearce@spearce.org","sentAt":"2011-01-11T19:30:29Z","receivedAt":"2011-01-11T19:30:29Z","isPatch":false,"sender":{"key":"spearce@spearce.org","avatar":"https://avatars.githubusercontent.com/u/34844?v=4"},"body":"On Tue, Jan 11, 2011 at 10:51, sundarbun <sundarbun@yahoo.com> wrote:\n> I am looking into using JGit from Java\n\nJGit related questions are probably better directed to the\njgit-dev@eclipse.org mailing list, as that is the list most of the\nJGit contributors monitor and answer questions on.  The project is\nhosted at http://www.eclipse.org/jgit/ so you may find more resources\nthere too, including the latest 0.10.1 release.\n\n> to get some files from source control\n> for an application that runs on AWS.\n> We currently use SVNKit and it seems to work fine. We recently made the\n> switch to git and I am having a hard time finding a sample that allows one\n> to\n> (a) init or create a ocal repo with my credentials and path to the tree that\n> I am interested in...\n\nUse the Git object in the org.eclipse.jgit.api package.  There is an\ninit method that can create a new repository at the given directory.\n\n> (a) get a bunch of files from my remote repo\n\nTry the checkout() method on the Git object.\n\n> (b) commit any changes back in...\n\nTry the commit() method on the Git object.\n\nBut if you want to avoid using the working directory, you'll need to\ngo through a much lower-level API, setting up your own DirCache, and\nusing an ObjectReader and ObjectInserter to interact with the\nRepository class.  Doing this requires some knowledge of the basic Git\ndata model (commits, trees, blobs).\n\n-- \nShawn.\n"},{"id":"159387","messageId":"1294783138346-5912619.post@n2.nabble.com","threadId":"26262","inReplyTo":"AANLkTin=bZAgYeKHN2NUjYjZU5NBC_bs3bpCNNhijppq@mail.gmail.com","subject":"Re: JGIT newbie question","fromName":"sundarbun","fromEmail":"sundarbun@yahoo.com","sentAt":"2011-01-11T21:58:58Z","receivedAt":"2011-01-11T21:58:58Z","isPatch":false,"sender":{"key":"sundarbun@yahoo.com","avatar":null},"body":"\nThanks Shawn.. I did look at the jGit list and I will post there as well.\n\n>>But if you want to avoid using the working directory\nNot sure what this means.. perhaps I have to read up some more...\n\nI got as far as what you have suggested with the Git object in the \norg.eclipse.jgit.api jar.\n\nWhere I got stumped was the specification of the userid/pwd/repo path\nparameters that tells git when I init it (as I run on an aws machine with no\n.git directory initially) to setup shop in a temp working directory that I\nspecify in the init. \n\nI was hoping to have an init command that I could pass a valid git repo url,\na user name and pwd and local fileDir so that a .git would be created and\nthen I can call checkout to get the part of the tree that I am interested\nin.\n\nIf you have any insight.. I'd appreciate your comments.\n\nthanks again.\nS\n\n-- \nView this message in context: http://git.661346.n2.nabble.com/JGIT-newbie-question-tp5911913p5912619.html\nSent from the git mailing list archive at Nabble.com.\n"}]}