Created
January 15, 2016 19:09
-
-
Save coccoinomane/d0e16414b439241015a0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# | |
# Git hook script to remove the annoying Icon? files created | |
# by Google Drive. | |
n_icon_files=`find . -name Icon? | grep -c /` | |
if [ $n_icon_files != "0" ]; then | |
echo "Will delete $n_icon_files files 'Icon?' generated by Google Drive\n" | |
find . -name Icon? -exec rm -f {} \; | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This simple bash script allows you to use a git repository inside the Google Drive folder.
The script automatically and recursively deletes all
Icon?
files created by Google Drive in your.git
folder before every commit. These files would otherwise potentially mess up your git repository.Place the script in the
.git/hooks
folder of your project. I also advise to do the following:which ensures the files are deleted also before every
git push
.