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

Parallel refactoring and git merge nightmare

From
PLPap Lôrinc <paplorinc@yahoo.com>
Date
Apr 11, 2012, 16:13 UTC
Message-ID
<1334160803.74554.YahooMailNeo@web160603.mail.bf1.yahoo.com>
Hello! :)

We are working in parallel on the refactoring of a small project. The team uses SVN and I decided to give GIT a chance to demonstrate it's merging capabilities I've read so much good about :).

However
 - I must be doing something VERY wrong - every time I try to merge from
 the remote svn (git svn fetch and git merge remotebranch) into my 
branch, I get hundreds of conflicts, mostly because of moved folders.
I
 tried it from the console (latest git), from Idea (11.1.1), from git 
extensions, from gitk, from tortoisegit and they all offer me a 
one-by-one resolution of the conflicts, that should have been resolved 
automatically (in Idea and tortoisegit I can select "theirs" to all the 
conflicts, but they still give errors at the end).
I think the 
problem arises because git doesn't track
 moves, therefore I constantly get conflicts of type "local modified, 
remote deleted" (or even both deleted) when in fact it was only modified
 and moved, it could have been merged without conflicts (-> apply my 
changes and move the file to the new location).
Even if I move 
the files manually (eg. from totalcommander) to their final locations (I
 have to copy each modified remote file to the new location ... still 
faster than going through the hundreds of conflicts in git mergetool 
manually, one-by-one), and added the files to the index, I have to hunt 
down the duplicated files, and the ones containing the 
"<<<<<" conflict markers (which often contain the two 
whole files ... not just their differences, even though they are clearly
 very similar), delete the merge file leftovers (theirs, base, local 
etc), copy the files over manually, that could not be merged etc. This 
is madness, I am merging manually!!!
I don't want conflict
 markers in my files, it's dangerous. Don't spam my files with garbage 
(and commit them later, because it was left unnoticed in the whole 
manual merge), use temporary files or whatever.

It would also be nice if conflicts could be ignored, if the match a certain regexp (eg. moving the same .java file in parallel might change the package or import statements, which will result in conflicts ... I don't care, use whichever, Idea will correct it anyway, I don't want to go through hundreds of files because of this). Some hooks could be activated on merge conflicts also.

What am I doing wrong, this manual or 
one-by-one merge is absurd :(? I want git to work because of all the bad
 experience I've had with TFS and SVN, but I just can't comprehend this.

Thank you for your patience, Pap Lőrinc

Next: Michael Witten
Message 1 of 9 in “Parallel refactoring and git merge nightmare”
  1. Pap LôrincApr 11, 2012
  2. Michael WittenApr 11, 2012
  3. David AguilarApr 12, 2012
  4. Pap LôrincApr 12, 2012
  5. Andrew ArdillApr 12, 2012
  6. David BarrApr 12, 2012
  7. Pap LôrincApr 12, 2012
  8. Eugene SajineApr 12, 2012
  9. Jeff KingApr 12, 2012

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.