This question already has an answer here:
How to tell git to ignore individual lines, i.e. gitignore for specific lines of code [duplicate]
You could set up a
.gitattributes file that can specifify that all merge conflicts are resolved using
This will stop the
mainWindow.ui from being overwritten by merges. Instead of conflicting, this will silently resolve the merge by accepting the current state of the file. This can be good if the developers have their own branches with settings in. If they work directly on master it will be less good, since they will then push their own settings.
Alternatively, and probably better in your case, each developer could force git to ignore changes to
git update-index --skip-worktree mainWindow.ui
This is quite confusing, but it makes Git disregard changes in the file when pushing but Git still tries to preserve the changes in the local file when pulling, only updating it if the remote is updated. An overview can be found here.