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

Re: How can git pull be up-to-date and git push fail?

From
Jeff King <peff@peff.net>
Date
Apr 7, 2007, 16:16 UTC
Message-ID
<20070407161607.GB18972@coredump.intra.peff.net>
In-Reply-To
<17941.25142.88657.766384@lisa.zopyra.com>
On Thu, Apr 05, 2007 at 03:55:18PM -0500, Bill Lear wrote:
Show 6 quoted lines
> No, just plain ol' git push.  One possibility is that in mediating
> between him and the list, there has been a loss of information.
> Perhaps he omitted details in his account of how things progressed ---
> who knows, perhaps he was on the wrong branch (though I doubt this, he
> only works on the master branch, and the other branch in question was
> someone else's entirely).

No, I think you gave the correct information. See the other part of the thread between me and Junio. What's happening is that 'git-push' tries to push every ref that both you and the remote have. Because he's pushing into a non-bare repository, both sides have refs/remotes/origin/flexify. But they're not necessarily at the same point, since they're both fetched from whatever your origin is, thus the problem. In this case, his flexify tracking branch for origin is _behind_ the remote's, so the push doesn's work.

> Regardless, does my assumption --- a 'git pull' should rectify
> the 'you are not up to date' problem --- hold in general?

Generally, yes. But the remotes/ hierarchy is not something you pull into. So in this case, it won't help. The real solution is that git-push should not be pushing remotes/ at all: it should be purely a local thing (the patch I posted elsewhere in the thread fixes this, but will not be the final behavior -- however, it's enough to fix this problem).

As a temporary solution, fetching from origin should put him at the same place (or ahead of) the remote, which should allow the push to go through.

-Peff
Previous: Bill LearNext: Junio C Hamano
Message 7 of 13 in “How can git pull be up-to-date and git push fail?”
  1. Bill LearApr 5, 2007
  2. Jeff KingApr 5, 2007
  3. Bill LearApr 5, 2007
  4. Bill LearApr 5, 2007
  5. Jeff KingApr 5, 2007
  6. Bill LearApr 5, 2007
  7. Jeff KingApr 7, 2007
  8. Junio C HamanoApr 5, 2007
  9. Jeff KingApr 6, 2007
  10. Junio C HamanoApr 6, 2007
  11. Jeff KingApr 7, 2007
  12. Junio C HamanoApr 7, 2007
  13. Jeff KingApr 7, 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.