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

Re: Your branch and 'origin/master' have diverged

From
HWHilco Wijbenga <hilco.wijbenga@gmail.com>
Date
Aug 14, 2012, 22:15 UTC
Message-ID
<CAE1pOi3a9ZMFfJ2qjkaZ_O-DuQa3xkKtsMU5GYYUuiwcRoFjbg@mail.gmail.com>
In-Reply-To
<87lihh8c7s.fsf@thomas.inf.ethz.ch>
On 14 August 2012 13:12, Thomas Rast <trast@student.ethz.ch> wrote:
Show 39 quoted lines
> Hilco Wijbenga <hilco.wijbenga@gmail.com> writes:
>
>> On 14 August 2012 10:19, Junio C Hamano <gitster@pobox.com> wrote:
>>> Hilco Wijbenga <hilco.wijbenga@gmail.com> writes:
>>>
>>>> On 14 August 2012 01:27, Thomas Rast <trast@student.ethz.ch> wrote:
>>>>> [git pull with two args] it's ok if you use it with an URL instead
>>>>> of a remote nickname
>>>>
>>>> Why would that be okay? What is the difference? Isn't the nickname
>>>> just an alias for a URL?
>>>
>>> As long as you tell what refspecs to use on the command line, the
>>> remote nickname behaves as "just an alias for a URL", so yes,
>>> because Thomas is discussing "two-arg pull or fetch", one arg being
>>> either nickname or URL and the other is an explicit refspec on the
>>> command line, it would be okay because there is no difference in
>>> that case.
>>
>> I suppose I'm not entirely clear on how this two step process is
>> "safer". Doing "git fetch" would seem to be harmless, right? So the
>> problem is with "git merge" but master should always be "behind"
>> origin/master so that "git merge" should just FF to origin/master
>> which *should* be completely safe. Does that make sense? Especially
>> given our use of master as an integration branch?
>>
>> [Given the trouble I have with getting people to use Git properly, I
>> prefer things as simple as possible. :-) ]
>
> I meant something else than Junio hinted at.  Saying
>
>   git fetch origin master
>   # or by extension
>   git pull origin master
>
> does not update the origin/* namespace, not even origin/master.  All
> fetching happens only into FETCH_HEAD.  This leads to confusion such as
> yours because origin/master and thus the upstream tracking displays will
> not know about the change.
I'll say. Now I'm really confused.

If what you say is true then what is updating origin/master? I've been using "git pull" daily for over a year and origin/master is definitely getting updated (at least according to gitk).

Mmm, just to make sure we are all talking about the same origin/master: I mean my local reference to the SHA1 of the commit that is master's HEAD on origin. After I have run "git pull", *my* master and *my* origin/master point to the same commit. Or I'm *really* confused. Or I've confused you by using incorrect terminology. :-) Or by using the right terminology incorrectly. ;-)

Previous: Jeff KingNext: Junio C Hamano
Message 17 of 20 in “Your branch and 'origin/master' have diverged”
  1. Hilco WijbengaAug 13, 2012
  2. Thomas RastAug 14, 2012
  3. Hilco WijbengaAug 14, 2012
  4. Junio C HamanoAug 14, 2012
  5. Hilco WijbengaAug 14, 2012
  6. Junio C HamanoAug 14, 2012
  7. Thomas RastAug 14, 2012
  8. Junio C HamanoAug 14, 2012
  9. Thomas RastAug 15, 2012
  10. Junio C HamanoAug 15, 2012
  11. Holger Hellmuth (IKS)Aug 15, 2012
  12. Junio C HamanoAug 15, 2012
  13. Junio C HamanoAug 15, 2012
  14. Jeff KingAug 16, 2012
  15. Junio C HamanoAug 16, 2012
  16. Jeff KingAug 16, 2012
  17. Hilco WijbengaAug 14, 2012
  18. Junio C HamanoAug 14, 2012
  19. PJ WeisbergAug 14, 2012
  20. Hilco WijbengaAug 14, 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.