Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit » Receiving tags and branches with jgit
Receiving tags and branches with jgit [message #673439] Mon, 23 May 2011 12:30 Go to next message
Lord_aratorn is currently offline Lord_aratorn
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 17:05 Go to previous message
Robin Rosenberg is currently offline Robin Rosenberg
Messages: 299
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: Thu Apr 24 01:34:17 EDT 2014

Powered by FUDForum. Page generated in 0.14106 seconds