-
-
Save jontsai/0ef7f37f75053d1e4e4a43e795975653 to your computer and use it in GitHub Desktop.
Revert file permission changes in local git repository.. Very useful when you change permissions due to working on a samba share.Lifted from: http://stackoverflow.com/questions/2517339/git-how-to-recover-the-file-permissions-git-thinks-the-file-should-be
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
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