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

Re: "git push" logic changed?

From
Junio C Hamano <junkio@cox.net>
Date
Jan 21, 2006, 00:03 UTC
Message-ID
<7vlkxa30rd.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<20060120225336.GA29206@kroah.com>
Greg KH <greg@kroah.com> writes:
> As of the git development tree from last night, 'git push' seems to work
> a bit differently now.

The change was 9e9b267. I suspect the earlier way was a bit more friendly to savvier people (especially the subsystem maintainers and the project lead), but it was found to be confusing for people who clone from an upstream and then use that as a shared repository. Their developers further clone from that shared repository, and as needed pull from the true upstream. When they push their changes back, "git push central:/shared.git/" would trigger a "remote origin does not fast forward" error, depending on when these developers fetched from the shared repository the last time, and whether they stored what they fetched from the shared repository in their "origin" or not. If you do "git pull central:/shared.git/", not "git pull origin" (taking advantage of remotes/origin file), your "origin" branch would become out-of-date. Which is OK for the purpose of maintaining "master" branch properly, but pushing meaningless "origin" back to "origin" at the shared repository (which is also meaningless) was triggering an error and causing confusion in that setup.

> Or should I always be doing --all?

In order to make sure all your local refs are on the "parent", then yes. And this is not new. It used to push all the refs that appear in _both_ your local repo and the "parent" repo, so your new tags and branches did not get propagated so you needed to use '--all' in such a case anyway. We now also have '--tags' to push all tags.

We could probably resurrect the earlier behaviour with a '--matching' option or something if you'd like.

Previous: Greg KHNext: Greg KH
Message 2 of 13 in “"git push" logic changed?”
  1. Greg KHJan 20, 2006
  2. Junio C HamanoJan 21, 2006
  3. Greg KHJan 21, 2006
  4. Junio C HamanoJan 21, 2006
  5. Junio C HamanoJan 21, 2006
  6. [RFC] Reverting "git push logic change"?Junio C Hamano, Jan 21, 2006
  7. Daniel BarkalowJan 22, 2006
  8. Junio C HamanoJan 22, 2006
  9. Junio C HamanoJan 22, 2006
  10. seanJan 22, 2006
  11. Junio C HamanoJan 22, 2006
  12. Junio C HamanoJan 23, 2006
  13. Greg KHJan 24, 2006

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.