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

Re: branch ahead in commits but push claims all up to date

From
Björn Steinbrink <b.steinbrink@gmx.de>
Date
Mar 26, 2009, 12:48 UTC
Message-ID
<20090326124816.GB3114@atjola.homenet>
In-Reply-To
<43d8ce650903251905p6f9798f5u79be7dff3b118d5c@mail.gmail.com>
On 2009.03.26 02:05:21 +0000, John Tapsell wrote:
Show 11 quoted lines
> 2009/3/25 Irene Ros <imirene@gmail.com>:
> > Thank you for the explanation, doing a git fetch actually did do the
> > trick although I still don't quite see the difference between
> > git pull origin myBranch
> > and
> > git fetch
> 
> git pull origin myBranch    is equivalent to two commands:
> 
> git fetch
> git merge origin/myBranch

No. If that was the case, the remote tracking branches would be updated by the "git fetch" part. And there wouldn't be a difference between the two commands WRT the handling of remote tracking branches.

git pull origin myBranch does something like:

git fetch origin myBranch git merge FETCH_HEAD

The remote and the refspec are passed to "git fetch" by "git pull". So because there's an explicit refspec, the default value from the config is not used. And because the refspec has no right side, things get stored to FETCH_HEAD.

Björn
Previous: John Tapsell
Message 13 of 13 in “branch ahead in commits but push claims all up to date”
  1. Irene RosMar 24, 2009
  2. Junio C HamanoMar 24, 2009
  3. John TapsellMar 24, 2009
  4. Daniel BarkalowMar 24, 2009
  5. John TapsellMar 25, 2009
  6. Daniel BarkalowMar 25, 2009
  7. Irene RosMar 25, 2009
  8. John TapsellMar 25, 2009
  9. Daniel BarkalowMar 25, 2009
  10. Irene RosMar 25, 2009
  11. Santi BéjarMar 25, 2009
  12. John TapsellMar 26, 2009
  13. Björn SteinbrinkMar 26, 2009

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.