i want a specified file always raise conflict when it have any changes, i search in the internet and i find merge.*.driver in .gitattribute, but this configuration is only effect when this file both changed in two branch, what i wanted is when the file is only change in one branch(in other word,there is no conflict in the file), git also invoke the driver that configured in .gitattribute and raise conflict.
the application scenarios is i want monitor the changes of specified file, and remind me of conflict when merge.
my project git branch structure as follow:
prod: init --- p1 --- p2
|
uat: ------u1 ----u2
when i receive a feature task,
i create a new branch from prod branch, named "f1"
when i transfer my code to uat , i merge the branch f1 base on uat
when i transfer my code to prod , i merge the branch f1 base on prod
there are only one log configuration file (like log4j2.xml) in each branch,
so when i develop in branch f1, i will change the log config fit my local environment,
when i transfer to uat, my local config will merge to uat (what i do not want to happen )
"ours" merge strategy is worked, when i not add something in log config file,
but when i add something, "ours" strategy also discard what i added.
and "merge.*.driver" is only worked there have changes in both brach.
so i want to know there is any solution to deal with this situation.
like if any change is exist of specific file when merge is triggered, git always raise conflict