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

Re: "git push" logic changed?

From
Greg KH <greg@kroah.com>
Date
Jan 21, 2006, 00:15 UTC
Message-ID
<20060121001547.GA30712@kroah.com>
In-Reply-To
<7vlkxa30rd.fsf@assigned-by-dhcp.cox.net>
On Fri, Jan 20, 2006 at 04:03:50PM -0800, Junio C Hamano wrote:
Show 23 quoted lines
> 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.
Well what should I do then to push to "orgin"?
	$ git push
	Where would you want to push today?
	Usage: /home/greg/bin/git-push [--all] [--tags] [--force] <repository> [<refspec>...]
	$ git push origin
	No refs given to be pushed.
Show 8 quoted lines
> > 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.

Yes, but "git push origin" used to push my local changes there, and that's all I really want.

Someone off-list told me I could edit my .git/branches/parent file to fix this issue for that branch. Since I hand-created that file in the first place, that's not a bit deal. But I was relying on git to get the "origin" branch right, as I didn't edit it at all :)

So, what I'm really just looking for is a simple way to push back to the repository that I cloned this one from, as I only have one "repo" here.

> We could probably resurrect the earlier behaviour with a
> '--matching' option or something if you'd like.
It would be nicer not to break a previously working command :)

Or at least show me how to change it so I can just easily push back to where I cloned the original from...

thanks,
greg k-h
Previous: Junio C HamanoNext: Junio C Hamano
Message 3 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.