Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git cherry-pick and merge by ignoring EOL changes

Recently in all of our repos, we added a git attribute file to all our repos. The idea was to force use the Unix EoL chars in all files. This created huge issues first day when you checkout to a new branch, it starts to show changes in the entire file. We simply committed it.

Now, the issue is if we merge from one branch to another (which we do quite often) or cherry-pick (we do more of it) the merge shows conflicts once again in all the files.

It would be ideal if git could ignore line endings or white space changes through a preference. Does anyone know if git contains something like this or if there is a workaround?

like image 710
openSource Avatar asked Nov 04 '22 19:11

openSource


1 Answers

Take a look at the git merge strategies. ie you can specify to use the ignore-space-at-eol - which might help you in this case. Alternatively you can try using ours to force your EOL changes to be taken.

like image 120
Máté Avatar answered Nov 07 '22 22:11

Máté