Use case: we have some project meta-data files which we want tracked, but are rarely (if ever) committed, though they are locally updated all the time (different users have different project paths). In regular scenarios, no user should ever commit these files unless explicitly required.
Git ignore is used for untracked files.
Is there a similar function for git to ignore tracked files? Is there a said method that I can change in the central repo, and will reflect on all users?
No in a general (distributed) context: no hook or process of any kind can be “changed” on a central location and picked by all distributed downstream repos.
If your user created their repo following a central template, then some default hook could reference a central script (i.e. a script accessible by all users in a shared disk, if we are speaking on users on the same network).
adymitruk‘s answer argues to use a development branch, hence not committing private changes to “public” branch (i.e. branch that is pushed/pulled).
That is well and good but:
It would be better to use a filter driver (which is declared in a
.gitattributesfile and can be propagated through clone) with:a
smudgescript:a
cleanscript: