Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jgit-dev] Set current branch on bare repository

On 02/08/2012 10:15 AM, Denis Bardadym wrote:
> I need to change current branch on bare Repository.

if i understood git concepts correctly, a bare repository does not have a current branch at all. thats the whole point of a bare repository, as "current branch" is just an abbreviation for "currently checked out branch".


> I try this:
> Repository r = ...;
> RefUpdate refUpdate = r.updateRef(Constants.HEAD, true);
> RefUpdate.Result res = refUpdate.update();
> as a result i get FAST_FORWARD (without detaching symbolic ref i get
> NO_CHANGE ). But when i call  r.getBranch() result is master branch.
> I think need to make some refresh or sync, but not sure. Can you help
> with this problem?
> Thanks, Denis Bardadym.
> _______________________________________________
> jgit-dev mailing list
> jgit-dev@xxxxxxxxxxx

Back to the top