Skip to content

Instantly share code, notes, and snippets.

@phette23
Created October 9, 2020 02:12
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 phette23/5bc330309c7fa2e835dfeecef449e929 to your computer and use it in GitHub Desktop.
Save phette23/5bc330309c7fa2e835dfeecef449e929 to your computer and use it in GitHub Desktop.
fix files modes in Drive git repos
#/usr/bin/env bash
# Google Drive messes up file modes by setting everything to 644 so all your executables are screwed up
# I store a bunch of git repos in a Drive folder (don't ask why) & this fixes the file modes by just checking out everything
for dir in $(ls -d */); do
cd ${dir}
git status 2&>/dev/null && git checkout -- .
cd -
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment