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

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).

Previous: Michael TuttyNext: Dennis Kaarsemaker
Message 8 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.