Skip to content

Instantly share code, notes, and snippets.

Avatar
🐷
^_^

Andrej Rypo dakujem

🐷
^_^
View GitHub Profile
@jtdp
jtdp / gist:5443498
Last active Sep 21, 2021
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
View gist:5443498
git diff -p \
| grep -E '^(diff|old mode|new mode)' \
| sed -e 's/^old/NEW/;s/^new/old/;s/^NEW/new/' \
| git apply