Who touched my git assume-unchanged bit?
It seems that --skip-worktree
+ sparse checkout could allow this sort of behavior.
From git assume unchanged vs skip worktree - ignoring a symbolic link (with some contextual modifications):
- Set
core.sparseCheckout
to true for the repository.- Create a file
.git/info/sparse-checkout
containing two patterns:*
to include everything and!/path/to/someFile.txt
to exclude local file 'someFile.txt'.- Now, manually set the skip-worktree bit to someFile.txt.
Now you can go on without having to fear that git will automatically commit the directory, but note that you will still run into problems if someone explicitly runs git add on the directory or any file in it.
Further research in the man page seems to indicate that --skip-worktree
is more appropriate for the use case being asked about.