Gangnus
Gangnus

Reputation: 24464

How to make visible the conflicts of the moved files

I am merging two branches. Both have got significant changes. Both branches obtained additional functionality and one of these branches includes moving of many files.

When merging, I see conflicts in the files that have these functionality changes intersected. These are files that have retained the same name and placing. These conflicts are quite easy to resolve.

But some (unknown for me) moved files had also changed. I need to insert the changed functionalities into the newly placed files. How can I find them, except analysing the project file by file?

Have IntelliJ and git some automation supporting these now invisible for me conflicts? I don't want much, the simple list of moved (in one branch) files with changed (in another branch) content would be enough for the first step.

Ok, I can somehow check these moved files one by one. But then I want to compare any file to this file on the previous place in another branch.

Upvotes: 0

Views: 408

Answers (3)

Vampire
Vampire

Reputation: 38639

Use git diff with the -M option which tells git do detect renames. If much of the file was changed, you might need to raise the threshold of -M by giving it an argument. Just -M is the same as -M50% or -M5 which all three mean "consider a file a rename of another deleted file if it is 50% similar".

Upvotes: 1

Gangnus
Gangnus

Reputation: 24464

I had found the solution:

  1. Pull branch B to branch A.
  2. Further work will be in branch A.
  3. In Project view of IntelliJ I choose the project a whole. Right click ->git -> compare with branch -> B.
  4. Now I have the list of all changed files, and the moved files are marked in that list as moved ones. I can work with them one by one.

Upvotes: 0

Vishwas
Vishwas

Reputation: 51

Not Sure about IntelliJ, but i guess you can use diff tool in git to configure beyond compare like tools. Eg: git config --global difftool.bc3.path "C:\apps\bc\BCompare.exe" then

git difftool <>

Upvotes: 0

Related Questions