Skip to content

Instantly share code, notes, and snippets.

@majidalaeinia
Created October 9, 2021 07:59
Show Gist options
  • Save majidalaeinia/d03719f9e27da046759eb10f18fee133 to your computer and use it in GitHub Desktop.
Save majidalaeinia/d03719f9e27da046759eb10f18fee133 to your computer and use it in GitHub Desktop.
Git Revert File Permissions

Git Revert File Permissions

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