|
Re: checkout with setUpstreamMode doesn't update config [message #898811 is a reply to message #898742] |
Fri, 27 July 2012 13:52  |
Eclipse User |
|
|
|
ZFabrik Mising name skrev 2012-07-27 14.19:> Hi all,
> I must say that I'm not a Git expert and so I'm not a jgit expert as
> well ;)
> So maybe the problem is in my approach and not in jgit ;)
>
> I'm using org.eclipse.jgit-2.0.0.201206130900-r.jar.
>
> There's a remote repository with two branches 'master' and 'v2.0', v2.0
> is the active one.
>
> Now I want to clone this repository and checkout master as remote
> tracking branch:
>
>
> Git repo = Git.cloneRepository().
> setURI(remoteUrl).
> setCloneAllBranches(true).
> setNoCheckout(false).
> setDirectory(repoDir).
> call();
>
> repo.branchCreate().
> setUpstreamMode(SetupUpstreamMode.TRACK).
> setName(branch).
> call();
You must call setStartPoint so JGit knows what branch to track, just
as you did with C Git.
-- robin
|
|
|
Powered by
FUDForum. Page generated in 0.27774 seconds