Who touched my git assume-unchanged bit? Who touched my git assume-unchanged bit? git git

Who touched my git assume-unchanged bit?


IIRC if you ignore a versioned file, it will behave like that. You can ignore across all work trees from .gitignore or in particular work tree from .git/info/exclude (yes, it works, but is not intended way of doing things).


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.