Re: Bug? git worktree fails with master on bare repo
- From
Kevin Daudt <me@ikke.info>
- Date
- Oct 11, 2016, 15:41 UTC
- Message-ID
- <20161011154137.GA20160@ikke.info>
- In-Reply-To
- <CAOi_75KR+AEAD540L=GtQ7jH5ngTFdHMq53+FzjzAfsZtTqfwg@mail.gmail.com>
On Mon, Oct 10, 2016 at 08:06:47AM -0500, Michael Tutty wrote:
Show 6 quoted lines
> > > If source repo's HEAD is "master", I got the same behavior (worktree add fails) > > So if it's possible for a bare repo to have HEAD pointing at master, > is there a safe way for me to change this (e.g., as a cleanup step > before doing my actual merge process)?
You can change where HEAD points to in a bare repositor with `git symbolic-ref HEAD <branch>`, but note that this changes what branch gets checked out when cloning a repository.
Where users would normally check out master by default, after changing what HEAD points to, it would be that branch (or detached when HEAD doesn't even point at a branch).