0

I made cherry-pick of a commit from the feature branch to the master branch. But these changed files was moved to another folder in master-branch. So I have used follow answer to merge moved files: git merge conflict due to moved files

But now I have a problem: instead of calculate the diff of replaced files git want to override them all. How can I recalculate difference for a correct merge-commit?

Kirill Golikov
  • 1,354
  • 1
  • 13
  • 27

1 Answers1

1

The problem was in

Some files have incorrect encodings or file-endings

It could be solved by next way:

# undo incorrect merge commit, if it is made 
$ git reset --soft <commit>
# hide changes
$ git stash
# change encodings or endings in your text editor
$ vim file
:set fileencoding=utf-8
:set ff=dos
:wq
# create commit
$ git commit -m "enc"
# apply merge
$ git stash apply
$ git commit -m "merge"
Community
  • 1
  • 1
Kirill Golikov
  • 1,354
  • 1
  • 13
  • 27