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

Re: origin/branchname and tracking branch pointing to different commits?

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 8, 2010, 17:25 UTC
Message-ID
<7vljaptp1j.fsf@alter.siamese.dyndns.org>
In-Reply-To
<AANLkTinLVd483-ki6tVb545PgpOFeOLYLR_GiKM5xAl7@mail.gmail.com>
Eugene Sajine <euguess@gmail.com> writes:
Show 27 quoted lines
> On Thu, Jan 7, 2010 at 8:32 PM, Junio C Hamano <gitster@pobox.com> wrote:
>> Eugene Sajine <euguess@gmail.com> writes:
>>
>>> $ git fetch origin branchname
>>>
>>> are both causing the output like this:
>>>
>>> From git://....
>>> * branch      branchname    -> FETCH_HEAD
>>> ...
>>>
>>> but "git fetch" says:
>>>
>>> From git://....
>>> * branch      branchname    -> origin/branchname
>>>
>>> Is this inconsistent behavior necessary by design?
>>
>> It is by design...
>
> I'm coming back to this topic as i see some confusion growing about
> such behavior. Every now and then users come across this problem and
> they expect pull to *really* behave as fetch and merge so it will
> cause the update of remote/branchname branch. And it is kind of
> difficult to justify why they have to do git fetch after pull...
>
> Can somebody, please, take a look?

In your transcript, they can say "git fetch" (or "git fetch origin") and branch is copied to origin/branch, so instead of doing:

    $ git fetch origin branchname
    $ git log FETCH_HEAD ;# or whatever inspection using FETCH_HEAD
they can do
    $ git fetch ;# or git fetch origin
    $ git log origin/branch ;# or whatever inspection using it

In short, teach them that they no longer have reason to learn or run "git fetch origin branchname".

Previous: Eugene SajineNext: Eugene Sajine
Message 8 of 14 in “origin/branchname and tracking branch pointing to different commits?”
  1. Eugene SajineJan 7, 2010
  2. Matthieu MoyJan 7, 2010
  3. Thomas RastJan 7, 2010
  4. Eugene SajineJan 7, 2010
  5. Eugene SajineJan 7, 2010
  6. Junio C HamanoJan 8, 2010
  7. Eugene SajineJun 8, 2010
  8. Junio C HamanoJun 8, 2010
  9. Eugene SajineJun 8, 2010
  10. Jeff KingJun 8, 2010
  11. Eugene SajineJun 28, 2010
  12. Junio C HamanoJun 29, 2010
  13. Eugene SajineJun 29, 2010
  14. Jeff KingJun 29, 2010

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.