Created
May 10, 2024 02:09
-
-
Save stevewoolcock/7cb289095acfa8e387eeaac52a17a9d9 to your computer and use it in GitHub Desktop.
Git: skip-worktree utilities
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Add skip-worktree flag all modified files | |
git ls-files --modified | tr '\012' '\000' | xargs -0 git update-index --skip-worktree | |
# Remove skip-worktree flags on all files | |
git ls-files -v | grep -i ^S | cut -c 3- | tr '\012' '\000' | xargs -0 git update-index --no-skip-worktree |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment