Consider space during Git merge

Issue

I just realized that Git is ignoring whitespaces during merge by default. However, I would like that Git would consider whitespace during merge. Is there someone that knows how can I configure it?

I tried to install older versions, but I could not find. The steps to install older version on Ubuntu would be nice.

Solution

Git should not ignore whitespace during merges, unless:

  • you add -Xignore-all-space (man page)
  • Or those changes were already merged in a previous merge commits
  • or you have defined a merge driver which would ignore whitespace (while a normal native git merge would not)

The OP GLEIPH GHIOTTO LIMA DE MENEZES confirms in the comments it is because of a merge driver which does not work well with the new merge default strategy ORT, resulting in a different context for diff.
Using merge -s recursive is enough for now to revert to the legacy behaviour.

Answered By – VonC

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published