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

Re: Can git be stopped from inserting conflict markers during a merge?

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
Mar 8, 2008, 20:51 UTC
Message-ID
<alpine.LFD.1.00.0803081242040.5896@woody.linux-foundation.org>
In-Reply-To
<loom.20080308T174918-559@post.gmane.org>
On Sat, 8 Mar 2008, William Tanksley wrote:
Show 6 quoted lines
>
> I started using Mercurial a while ago, and I'd like to move up to git (for a
> number of reasons). The one thing that's stopping me is that (having recently
> escaped subversion and cvs) I'm now used to NOT having to worry about conflict
> markers being shoved into files. To put it simply, I really like how Mercurial
> does that one thing.
Can you describe what "that one thing" is?
> So, given the git is probably the ultimate in configurability, what do I need to
> do to make it not insert merge markers?

Do you want to just have both (with the base version, all three?) versions of the file in your directory?

That's actually conceptually what you have with git, even though what git does is to keep the different untouched versions in the index. So with git, you actually have *four* different versions of a file when you have a conflict:

 - the working tree one (which has the conflict markers, because that's 
   traditional)
 - and index stages 1 (base) 2 (ours) and 3 (theirs)
which is why when you do
	git diff

on an unmerged file, you actually get something much more powerful than just the conflict entries - you get a git multi-version diff. It's *really* convenient when you get used to it, but I you actually seem to be wanting something much simpler.

			Linus
Previous: William TanksleyNext: Martin Langhoff
Message 2 of 4 in “Can git be stopped from inserting conflict markers during a merge?”
  1. William TanksleyMar 8, 2008
  2. Linus TorvaldsMar 8, 2008
  3. Martin LanghoffMar 8, 2008
  4. Jakub NarebskiMar 8, 2008

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.