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

Re: git push from client is not updating files on server

From
Junio C Hamano <gitster@pobox.com>
Date
Mar 6, 2012, 19:35 UTC
Message-ID
<7vsjhlsetn.fsf@alter.siamese.dyndns.org>
In-Reply-To
<jj5ih2$f0m$1@dough.gmane.org>
[jc: resurrected JY as recipient]
Ben Tebulin <nntp.20.jexpert@spamgourmet.com> writes:
> You can only push to "bare-only repositories". These do not contain a
> working tree but only a .git directory.

That's a bit too strong. You do not have to limit your "push" into "bare repositories" (drop "-only", there is no such word), but it is perfectly fine to use "push" as a way to emulate a "fetch" that you would wish you could but you cannot in the opposite direction.

What "push" does not do is to touch the working tree, and this is intuitively understandable once you realize that "push" is an opposite of "fetch".

> My push seems to be successful too using the command below as I get
> the message "Everything up-to-date".
> 
> git push
It is somewhat strange that this _succeeded_.

When pushing into a repository with a working tree (i.e. "a non-bare repository") and especially when trying to update its current branch with such a push, "git push" would by default be refused, unless you tweak a configuration variable or two on the receiving end. That is an expert feature and I do not think that is being in use in this particular scenario, so perhaps the push did _not_ succeed to update the branch Jerome thought it updated, but instead updated a branch that is _not_ the one that is checked out in the repository on the receiving end of this push.

Previous: Ben TebulinNext: Neal Kreitzinger
Message 3 of 15 in “git push from client is not updating files on server”
  1. Jerome YangaMar 6, 2012
  2. Ben TebulinMar 6, 2012
  3. Junio C HamanoMar 6, 2012
  4. Neal KreitzingerMar 6, 2012
  5. Neal KreitzingerMar 6, 2012
  6. Junio C HamanoMar 6, 2012
  7. Jerome YangaMar 6, 2012
  8. Neal KreitzingerMar 6, 2012
  9. Jerome YangaMar 7, 2012
  10. Neal KreitzingerMar 7, 2012
  11. Junio C HamanoMar 7, 2012
  12. Neal KreitzingerMar 7, 2012
  13. Holger HellmuthMar 7, 2012
  14. Jerome YangaMar 7, 2012
  15. Jerome YangaMar 30, 2012

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.