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

Re: Git is not recognizing some merge conflicts and just accepting incoming master version

From
Johannes Sixt <j6t@kdbg.org>
Date
Mar 15, 2024, 07:24 UTC
Message-ID
<606fe3fa-a5a0-4d35-a4a0-59521043dde4@kdbg.org>
In-Reply-To
<CA+XMOBuK1_BNqgQRfCne8dVXKGPt+iQ9wt4iZqz0PgEqZ5UCtg@mail.gmail.com>
Am 14.03.24 um 11:30 schrieb Kai:
Show 6 quoted lines
> I am encountering strange behavior when trying to merge master into a
> feature branch. Trying with guis VScode and Gitkraken, both are not
> displaying all conflicts in the files correctly and are just accepting
> some changes from master which are conflicts and break the code.
> 
> I am including two example files as well as screenshots.

No files were included in this message. Don't post screenshots when the content can also be represented as text.

That said, a conflict needs three files, not two: the base version, their version, and our version. But better than file attachments would be to just paste the relevant parts into the message (if you know what the relevant parts are and that other parts are not relevant).

Show 6 quoted lines
> In the first example, the conflict of the UseFormReturn type changing
> between the two versions of the file is not being recognized.
> 
> In the second example the useForm hook is completely different between
> master and the feature branch called hook-form, but no conflict is
> displayed.

These descriptions sound like the conflicts are of semantic kind. Git can't help in such cases. Git can only detect textual conflicts, that is, when both sides modify the same or adjacent lines of code in different ways.

-- Hannes
Previous: KaiNext: Kai
Message 2 of 8 in “Git is not recognizing some merge conflicts and just accepting incoming master version”
  1. KaiMar 14, 2024
  2. Johannes SixtMar 15, 2024
  3. KaiMar 15, 2024
  4. brian m. carlsonMar 15, 2024
  5. Johannes SixtMar 15, 2024
  6. Junio C HamanoMar 15, 2024
  7. KaiMar 16, 2024
  8. Thomas GuyotMar 23, 2024

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.