Re: Bug? git worktree fails with master on bare repo
- From
Michael Tutty <mtutty@gforgegroup.com>
- Date
- Oct 10, 2016, 13:06 UTC
- Message-ID
- <CAOi_75KR+AEAD540L=GtQ7jH5ngTFdHMq53+FzjzAfsZtTqfwg@mail.gmail.com>
- In-Reply-To
- <CACsJy8DMKWeZ+DuQ0uoY6rdPfusq8D1SfBCkPyn+6X9S589ncg@mail.gmail.com>
> If I create a bare _clone_, then "HEAD" could be detached, or point to some branch, depending on where "HEAD" is in the source repo
I didn't mean a clone, I meant a brand-new (bare) repo. Then I would clone it somewhere, add commits and branches, and push them to the bare repo.
> 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)?
On Mon, Oct 10, 2016 at 4:45 AM, Duy Nguyen <pclouds@gmail.com> wrote:
Show 23 quoted lines
> On Sun, Oct 9, 2016 at 8:42 PM, Michael Tutty <mtutty@gforgegroup.com> wrote: >> Dennis, >> Thanks for the great response, and for spending time on my issue. >> I'll try that first patch and see what happens. >> >> In the meantime, it got weirder... >> >> I created a brand-new (bare) repo > > Elaboration needed here. If I create a bare _clone_, then "HEAD" could > be detached, or point to some branch, depending on where "HEAD" is in > the source repo. If source repo's HEAD is "master", I got the same > behavior (worktree add fails). If it's detached or points to some > other branch, it's ok. If this is "git init --bare" then I got "fatal: > invalid reference: master". > >> and was able to git add worktree >> /path master. I was able to do this repeatedly, even using the >> worktree to merge other branches to master. I didn't find any >> condition or step that caused some kind of orphan master work tree, >> which was what I thought the underlying problem might be. > -- > Duy
-- Michael Tutty, CTO e: mtutty@gforgegroup.com t: @mtutty, @gforgegroup v: 515-789-0772 w: http://gforgegroup.com, http://gforge.com