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

Re: Bug-Report: Git automerge merges in old content not present on the latest commit of both branches.

From
Johannes Sixt <j6t@kdbg.org>
Date
Jan 20, 2025, 20:06 UTC
Message-ID
<e2ab3d74-2218-4a42-a2f5-019b306e185b@kdbg.org>
In-Reply-To
<AM0PR0702MB3555EE09E6BFD34A1F1429E1D8E72@AM0PR0702MB3555.eurprd07.prod.outlook.com>

The behavior is surprising, because I haven't seen git merge do something wrong since ages if ever.

Am 20.01.25 um 09:16 schrieb Postolache Andreas:
Show 5 quoted lines
> A:During the auto-merge it added Text from an 5 month old commit,
> that was the 6th newest commit and the 4th oldest. This text was not
> present on either the up-to date main branch or my working branch. 
> This was text from my first commit on the file, which was an .md
> file.

Without concrete data, it is difficult to asses where you started and what the result should be. Let's start with some `git log` output so that we all know what the shape of the commit graph is. We'll have to work from there or maybe you already know what is going on when you prepare it.

Show the output of
git log --graph --oneline --decorate --boundary main...mybranch -- file.md

Replace "main" by the branch name that you called "the up-to-date main branch", "mybranch" by "my working branch", and "file.md" by the path(spec) of the file in question. Mind the three dots and the dash-dash.

-- Hannes
Previous: Postolache Andreas
Message 2 of 2 in “Bug-Report: Git automerge merges in old content not present on the latest commit of both branches.”
  1. Postolache AndreasJan 20, 2025
  2. Johannes SixtJan 20, 2025

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.