Receiving tags and branches with jgit [message #673439] |
Mon, 23 May 2011 12:30  |
Eclipse User |
|
|
|
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  |
Eclipse User |
|
|
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.24113 seconds