git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Bug? git worktree fails with master on bare repo

From
Duy Nguyen <pclouds@gmail.com>
Date
Oct 10, 2016, 09:45 UTC
Message-ID
<CACsJy8DMKWeZ+DuQ0uoY6rdPfusq8D1SfBCkPyn+6X9S589ncg@mail.gmail.com>
In-Reply-To
<CAOi_75+Zoeeq5FD1HKgG4MjeL9LkBshsSfdrMOTi8m-Mt-OQNQ@mail.gmail.com>
On Sun, Oct 9, 2016 at 8:42 PM, Michael Tutty <mtutty@gforgegroup.com> wrote:
Show 7 quoted lines
> 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".

Show 5 quoted lines
> 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
Previous: Michael TuttyNext: Michael Tutty
Message 6 of 14 in “Bug? git worktree fails with master on bare repo”
  1. Michael TuttyOct 9, 2016
  2. Kevin DaudtOct 9, 2016
  3. Dennis KaarsemakerOct 9, 2016
  4. Duy NguyenOct 9, 2016
  5. Michael TuttyOct 9, 2016
  6. Duy NguyenOct 10, 2016
  7. Michael TuttyOct 10, 2016
  8. Kevin DaudtOct 11, 2016
  9. worktree: allow the main brach of a bare repository to be checked outDennis Kaarsemaker, Oct 12, 2016
  10. Michael TuttyOct 12, 2016
  11. Junio C HamanoOct 12, 2016
  12. Junio C HamanoOct 12, 2016
  13. Duy NguyenOct 13, 2016
  14. Dennis KaarsemakerOct 12, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.