Skip to content

Instantly share code, notes, and snippets.

@desyncr
Created July 6, 2015 18:13
Show Gist options
  • Save desyncr/84cf0c6d84729b138e13 to your computer and use it in GitHub Desktop.
Save desyncr/84cf0c6d84729b138e13 to your computer and use it in GitHub Desktop.
Fix permissions
git diff "$@" |
perl -ne '
if (/^diff/) { $diff = $_ }
elsif (/^old mode/) { print $diff, $_ }
elsif (/^new mode/) { print $_ }
' |
git apply -R
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment