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

Re: Merge problems.

From
Linus Torvalds <torvalds@osdl.org>
Date
Feb 5, 2006, 00:13 UTC
Message-ID
<Pine.LNX.4.64.0602041604290.3854@g5.osdl.org>
In-Reply-To
<43E52FD3.20202@f2s.com>
On Sat, 4 Feb 2006, Ian Molton wrote:
Show 10 quoted lines
>
> Doing the following:
> 
> git checkout -b mywork v2.6.12
> # work, work, work
> git commit -a
> git merge "Merging happily." mywork v2.6.15
> 
> At theat point I get a merge failure - I assume that means I've
> got conflicts. I forgot to not the exact error.

It would be interesting to hear what the error is, but yes, it sounds like file-level conflicts. However, the fact that you get them for files you haven't even touched:

> so I can see unmerged files using git ls-files --unmerged which lists a
> lot of SHA1 hashes and paths. but most of the files in the list I havent
> touched! why would they have any conflicts? surely they would simply
> update 2.6.12->2.6.15 ?

You really shouldn't get any conflicts for anything you haven't touched, since your starting point and the thing you are mergeing to are related, so they shouldn't have any issues.

One common error people have is that the "merge" binary isn't in their path, and the actual error is that the first path you _did_ touch failed to do a three-way merge, and the merge simply has never happened.

If you do _just_ "merge" (no "git", no aguments, no _nothing_), do you get a message like

	merge: not enough arguments
	merge: usage: merge [-AeEpqxX3] [-L lab [-L lab [-L lab]]] file1 file2 file3
	merge aborted
(which is ok) or do you get a message like
	bash: merge: command not found
(which means that you don't have a three-way merge at all)?
If you don't have the merge command, install the rcs package.
> The SHA1 hashes are all listed at least twice per file too, eg.
> 
> 100644 d058e65daf19f4bb8c257e2273f4c935ccee5121 1 Documentation/DocBook/scsidrivers.tmpl
> 100644 d058e65daf19f4bb8c257e2273f4c935ccee5121 2 Documentation/DocBook/scsidrivers.tmpl

That's the "stage1" and "stage2" results. The SHA1's are identical, so it should merge beautifully, and it does sound like the merge was never even really attempted.

So
 - do a "git reset --hard" to undo the partial (undone) merge
 - do "yum install rcs" (or apt get, or whatever) to make sure that you 
   have the three-way merge binary.
 - if it still doesn't work, please make sure to save all the error 
   messages so that we can see them..
Thanks,
		Linus
Previous: Ian Molton
Message 2 of 2 in “Merge problems.”
  1. Ian MoltonFeb 4, 2006
  2. Linus TorvaldsFeb 5, 2006

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.