I had a Git repo that I was storing on Google Drive (Yes that probably was not a great idea, but it was a lazy way of sharing some pdfs in the repo with a non-technical coworker). The Google Drive app on the Mac uses an “Icon” file to indicate sync statuses of folders. Unfortunately this kept screwing up the repo by also putting “Icon” files in all the folders in the .git directory. Having the repo was more important than it being in Google Drive so I moved the folder out of Google Drive. Once the folder was moved the “Icon” files remained and the repo was still throwing an error when I tried to code in Adobe Brackets.
Here is how I cleaned up all the Google Drive “Icon” files.
WARNING: BE SURE YOU DON’T HAVE FILES NAMED WITH “Icon” AS THE FIRST 4 LETTERS OR THIS WILL DELETE THEM.
- Open terminal
- Change directories into the folder that was once in Google Drive
- Issue the following terminal command:
find . -name 'Icon*' -type f -delete
Now the repo is back to normal.