Unfortunately not. Git does not support this feature, so you are probably out of luck. There are various ways to get files with local ignore in different repositories ( .git/info/exclude ) or on different computers (global ignore), but nothing happens based on the source code.
The simplest workaround is to have a βpublicβ branch in which this file is deleted and commit it to ensure that the public branch never accepted the commit that added it.
No reassurances that the blob will never leak into the public copy, however.
source share