Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save stevewoolcock/7cb289095acfa8e387eeaac52a17a9d9 to your computer and use it in GitHub Desktop.
Save stevewoolcock/7cb289095acfa8e387eeaac52a17a9d9 to your computer and use it in GitHub Desktop.
Git: skip-worktree utilities
# 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