Have git "assume-unchanged" a file for everyone, not just locally

This is a bit of a hack, but it's a git-only solution that will work.

  1. Create a new repository that contains only this file and include this new repository in your main repository as a submodule.
  2. Modify .gitmodules in your main repository with the ignore=dirty tag for this new submodule.

So now, when this file is modified, the submodule will be marked as dirty but people using the repository won't see the submodule marked as dirty when checking git status. What's more, they can pull and push at will without sharing the changes made to the file in the submodule.

Tags:

Git