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

Re: "warning: Updating the currently checked out branch may cause confusion" on bare repositories

From
Shawn O. Pearce <spearce@spearce.org>
Date
Jan 19, 2010, 18:59 UTC
Message-ID
<20100119185906.GF23466@spearce.org>
In-Reply-To
<xuu2my093owy.fsf@nowhere.com>
Adam Megacz <adam@megacz.com> wrote:
Show 8 quoted lines
> "Shawn O. Pearce" <spearce@spearce.org> writes:
> > That should already be the case.  Did you create the bare repository
> > by taking a copy of a non-bare's .git directory?  Check your bare
> > repository's config file and see if core.bare = false, if so set
> > it to true to signal it really is bare.
> 
> Hrm, is there a reason why this is explicitly configured rather than
> detected?
I don't know why we do this.  I think its because the guessing
logic can guess wrong sometimes.
 
> I was under the impression that you could create a bare repository by
> simply throwing away the working tree and renaming ".git" to any other
> name, but I guess I was wrong.

If you delete the setting from the configuration file, Git usually almost always guesses correctly. :-)

Its rare to see it fail. But I think it can fail if you create a file called HEAD in the top level of your source code tree. (For example.)

-- 
Shawn.
Previous: Adam MegaczNext: Jeff King
Message 4 of 5 in “"warning: Updating the currently checked out branch may cause confusion" on bare repositories”
  1. Adam MegaczJan 18, 2010
  2. Shawn O. PearceJan 19, 2010
  3. Adam MegaczJan 19, 2010
  4. Shawn O. PearceJan 19, 2010
  5. Jeff KingJan 19, 2010

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.