Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mystery git branch called 'Icon'

Tags:

git

macos

I am working on OSX Yosemite. I seem to have a branch called Icon, which I certainly haven't created deliberately:

$ git branch
Icon
* master

But if I try to delete it does not find the branch:

$ git branch -D Icon
error: branch 'Icon' not found.

Similarly, I can't check it out:

$ git checkout Icon
error: pathspec 'Icon' did not match any file(s) known to git.

What on earth is going on?

like image 851
Richard Avatar asked Jan 28 '26 10:01

Richard


1 Answers

It's not a branch. The Icon? files are auto created by Google Drive sync client for OS X, and are a pain especially when you are using Git. When you created the repo (or cloned it), OS X automatically put an Icon? file in every single directory, including your .git/branches directory:

$ ls .git/branches/
Icon?

See these related threads for more info: How to ignore Icon? in git https://productforums.google.com/forum/#!topic/drive/6SIZ7nhNO4w

like image 147
avioing Avatar answered Jan 31 '26 02:01

avioing



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!