Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
GIT revert file mode changes
#!/usr/bin/env bash
cd $1
git diff -p -R --no-color | grep -E "^(diff|(old|new) mode)" --color=never | git apply
## add git alias with name "permission-reset"
git config --global --add alias.permission-reset '!git diff -p -R --no-color | grep -E "^(diff|(old|new) mode)" --color=never | git apply'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment