git error as follow:
$ git pull
c4217267b..c2a93998a master -> origin/master
error: cannot update the ref 'refs/remotes/origin/bubble/49309': unable to append to '.git/logs/refs/remotes/origin/bubble/49309': Not a directory
! [new branch] bubble/49309 -> origin/bubble/49309 (unable to update local ref)
error: cannot update the ref 'refs/remotes/origin/bubble/50071': unable to append to '.git/logs/refs/remotes/origin/bubble/50071': Not a directory
! [new branch] bubble/50071 -> origin/bubble/50071 (unable to update local ref)
git pull would succeed when I command the following instead.
$ git pull origin master
But it isn’t very pleasant whenever you wanna sync up your branches.
Reference from this, you cannot have multiple branches, whose names from the beginning up to any slash (or to the end), differ only in upper and lower case.
- Check your branch names which are related to the error ones.
$ git ls-remote --heads | grep 'Bubble\|bubble'
2. Remove the problematic branch.
$ git branch -d Bubble/12345
^^^ delete the branch
$ git push -d origin Bubble/12345
^^^ delete the branch remotely
3. Prune origin
$ git remote prune origin
* [pruned] origin/Bubble/12345
4. Clear .git/refs
$ rm -rf .git/refs/remotes/origin/*
Reference from the followings: