Skip to content

Instantly share code, notes, and snippets.

@tracdi
Forked from jtdp/gist:5443498
Last active May 14, 2019 07:17
Show Gist options
  • Save tracdi/55d6309bda1f70a178b9ba0b18c05aeb to your computer and use it in GitHub Desktop.
Save tracdi/55d6309bda1f70a178b9ba0b18c05aeb to your computer and use it in GitHub Desktop.
GIT - Revert file permission
git diff -p \
| grep -E '^(diff|old mode|new mode)' \
| sed -e 's/^old/NEW/;s/^new/old/;s/^NEW/new/' \
| git apply
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment