Let\'s say I have this worktree that has already been tracked by git.
.
├── parent
│ ├── child1
│ | └── file1.txt
│ ├── child2
│ | ├── file2.txt
│
Similarly to assume-unchanged, you need to apply this command to all files within a folder:
find . -maxdepth 1 -type d \( ! -name . \) -exec bash -c "cd '{}' && pwd && git ls-files -z ${pwd} | xargs -0 git update-index --skip-worktree" \;
(there is no "recursive" option to git update-index)
EDITED:
Don't forget to cd
into the directory that you want to skip
first, then run the above commands.
And, if you want to undo it, just do the opposites with this:
find . -maxdepth 1 -type d \( ! -name . \) -exec bash -c "cd '{}' && pwd && git ls-files -z ${pwd} | xargs -0 git update-index --no-skip-worktree" \;