Skip to content

Instantly share code, notes, and snippets.

@marianposaceanu
Last active August 29, 2015 14:01
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 marianposaceanu/536138dd326983e5f044 to your computer and use it in GitHub Desktop.
Save marianposaceanu/536138dd326983e5f044 to your computer and use it in GitHub Desktop.

How to fix the Reference has invalid format in git repos due to Google Drive

find . -type f -name "* (1)*" -exec rm -f {} \;
awk '!/conflicted/' .git/packed-refs > temp && mv temp .git/packed-refs

Note: those two lines are destructive commands if you first want to see what they do try:

find . -type f -name "* (1)*"
awk '!/conflicted/' .git/packed-refs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment