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

Re: How does git follow branch history across a merge commit?

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 28, 2009, 23:32 UTC
Message-ID
<7vmy5jbjkr.fsf@alter.siamese.dyndns.org>
In-Reply-To
<7vskfbcy9n.fsf@alter.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
Show 6 quoted lines
> "Steven E. Harris" <seh@panix.com> writes:
>
>> Was it just luck that "HEAD^" referred to the predecessor that came from
>> branch "master" rather than branch "competition"?
>
> Yes, if you want the second parent you would say HEAD^2.

Ahh, I misread your question. No, it is not luck. If you merge competition into your master, the resulting commit will have your master as its first parent. If check out competition and merge master in your example, the resulting merge will have compatition as the first parent.

Previous: Junio C HamanoNext: Steven E. Harris
Message 3 of 7 in “How does git follow branch history across a merge commit?”
  1. Steven E. HarrisAug 28, 2009
  2. Junio C HamanoAug 28, 2009
  3. Junio C HamanoAug 28, 2009
  4. Steven E. HarrisAug 28, 2009
  5. Junio C HamanoAug 29, 2009
  6. Steven E. HarrisAug 30, 2009
  7. Björn SteinbrinkAug 29, 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.