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

Pushing into a repository with working directory?

From
Shawn O. Pearce <spearce@spearce.org>
Date
Jan 2, 2007, 04:51 UTC
Message-ID
<20070102045108.GC27690@spearce.org>

So tonight on #git I think I answered for the 10th time why the working directory doesn't update after a push to its associated repository.

We all know its somewhat dangerous to push into the current branch of a working directory, especially if that working directory contains uncommitted changes, as HEAD no longer matches the index.

But we all also know its incredibly useful to be able to push into a repository with a working directory, so we certainly don't want to disallow it entirely.

What about refusing a push to the current branch (branch listed in $GIT_DIR/HEAD) and the repository appears to have a working directory (is_bare_git_dir is false)?

-- 
Shawn.
Next: Andy Whitcroft
Message 1 of 11 in “Pushing into a repository with working directory?”
  1. Shawn O. PearceJan 2, 2007
  2. Andy WhitcroftJan 5, 2007
  3. Junio C HamanoJan 5, 2007
  4. Andy WhitcroftJan 5, 2007
  5. Junio C HamanoJan 5, 2007
  6. Shawn O. PearceJan 5, 2007
  7. Andy WhitcroftJan 8, 2007
  8. Junio C HamanoJan 9, 2007
  9. Shawn O. PearceJan 9, 2007
  10. Andreas EricssonJan 9, 2007
  11. Johannes SchindelinJan 9, 2007

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.