Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit / JGit » Receiving tags and branches with jgit
Receiving tags and branches with jgit [message #673439] Mon, 23 May 2011 16:30 Go to next message
Lord_aratorn is currently offline Lord_aratornFriend
Messages: 2
Registered: May 2011
Junior Member
Hey guys,

i just get started with jGit.
So i just wanna inform myself and were reading the userguide.
After that i would start it up.
So i added the jar-file to the project-buildpath, created a new class, created a main-mathod, copyed this code lines into the method and modifyed the directory.
Quote:
FileRepositoryBuilder builder = new RepositoryBuilder();
Repository repository = builder.setGitDir("/my/git/directory")
.readEnvironment() // scan environment GIT_* variables
.findGitDir() // scan up the file system tree
.build();



And the result was disapointing. The stuff doesn't work.
builder.setGitDir demands a file-object, and RepositoryBuilder can't be converted to FileRepositoryBuilder.

What do i have to do, to get startet?
Re: Receiving tags and branches with jgit [message #673498 is a reply to message #673439] Mon, 23 May 2011 21:05 Go to previous message
Robin Rosenberg is currently offline Robin RosenbergFriend
Messages: 332
Registered: July 2009
Senior Member
On 2011-05-23 18.30, forums-noreply@eclipse.org wrote:
> Hey guys,
>
> i just get started with jGit.
> So i just wanna inform myself and were reading the userguide.
> After that i would start it up.
> So i added the jar-file to the project-buildpath, created a new class,
> created a main-mathod, copyed this code lines into the method and
> modifyed the directory.
> Quote:
>> FileRepositoryBuilder builder = new RepositoryBuilder();
>> Repository repository = builder.setGitDir("/my/git/directory")
>> .readEnvironment() // scan environment GIT_* variables
>> .findGitDir() // scan up the file system tree
>> .build();
>
>
>
> And the result was disapointing. The stuff doesn't work.
> builder.setGitDir demands a file-object, and RepositoryBuilder can't be
> converted to FileRepositoryBuilder.
>
> What do i have to do, to get startet?

Construct a File object att pass to setGitDir. You also don't need
findGitDir since you already set it.

-- robin
Previous Topic:Newbie questions
Next Topic:I just can't seem to commit...
Goto Forum:
  


Current Time: Mon Sep 23 23:46:33 GMT 2024

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

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

Back to the top