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

Merge without marking conflicts in working tree

From
Aaron Schrab <aaron@schrab.com>
Date
Nov 17, 2014, 22:38 UTC
Message-ID
<20141117223836.GH615@pug.qqx.org>

Is there a way to do a merge but only record conflicts in the index, not update the working versions of files with conflict markers?

Like many people, I use git to manage configuration files for my shell, editor, git itself, and a number of other things. The vast majority of times that I update things no conflicts are occur and everything just works, so I'd like to avoid extra work in this case. But occasionally a conflict will occur, and if it's in a file that will be read while trying to resolve the conflict this can make things more difficult.

I'd like to find a way to have the conflict recorded in just the index without touching the working tree. I could then use my usual tools to resolve the conflict without the errors caused by the conflict markers. I generally use vim+fugitive to resolve conflicts anyway, and typically the first step I take is to replace the working-tree version with the merge-base version, completely ignoring any conflict markers.

If there isn't currently a way to do this, I was thinking of implementing something like an "ours" value for merge.conflictstyle configuration.

Next: Junio C Hamano
Message 1 of 3 in “Merge without marking conflicts in working tree”
  1. Aaron SchrabNov 17, 2014
  2. Junio C HamanoNov 17, 2014
  3. Andreas SchwabNov 17, 2014

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.