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

Re: Pushing to a non-bare repository

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
Feb 3, 2007, 19:48 UTC
Message-ID
<Pine.LNX.4.64.0702031146050.8424@woody.linux-foundation.org>
In-Reply-To
<45C459DD.8080201@fs.ei.tum.de>
On Sat, 3 Feb 2007, Simon 'corecode' Schubert wrote:
> 
> However, your suggestion does not help people who don't know better.  Pushing
> into the HEAD branch of another repo breaks stuff there.  Badly.  This should
> be prevented, really.
No, please don't break it. I do it all the time.
I just do "git push remote".

And then eventually on the remote end I do end up having to "update", but that's a simple "git checkout -f".

It's actually really convenient. It works even if the remote end had dirty stuff in their tree, and "git diff" still works (because the push didn't update the index), and a simple "git diff HEAD" shows that "oops, we're not up-to-date".

Yeah, I guess it's a bit error-prone ("Why does 'git log' say I have a new version, but the working tree doesn't seem new?"), but it actually does work.

		Linus
Previous: Junio C HamanoNext: Junio C Hamano
Message 5 of 6 in “Pushing to a non-bare repository”
  1. Steven GrimmFeb 3, 2007
  2. Junio C HamanoFeb 3, 2007
  3. Simon 'corecode' SchubertFeb 3, 2007
  4. Junio C HamanoFeb 3, 2007
  5. Linus TorvaldsFeb 3, 2007
  6. Junio C HamanoFeb 3, 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.