Skip to content

Instantly share code, notes, and snippets.

@nmyers
Created May 10, 2019 08:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nmyers/d5e0a57c637045be85fd4deafdd001d4 to your computer and use it in GitHub Desktop.
Save nmyers/d5e0a57c637045be85fd4deafdd001d4 to your computer and use it in GitHub Desktop.
Patch permission changes
#see https://stackoverflow.com/questions/2517339/how-to-restore-the-permissions-of-files-and-directories-within-git-if-they-have
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