Say I\'m collaborating with someone via a git repository, and there is a particular file that I never want to accept any external changes to.
Is there any way for me
As @ciro-santilli has commented, the simple way to do it to use .gitattributes
with settings it:
path/to/file merge=ours
and enable this strategy with:
git config --global merge.ours.driver true
(I am adding this as an answer to make it more visible but making it a Community Wiki to not try to get above user's credits for myself. Please upvote his comment under the Q here to give him kudos!)