duplicate ref file

# inspect
# inspect suspicious refs  
find .git/refs/heads -maxdepth 1 -type f -name '* 2*' -print
# expected out put
# refs/heads/icloud 2
 
# delete the bad duplicated ref  
rm ".git/refs/heads/icloud 2"
# fetch again  
git fetch --prune
# verify
git branch -vv  
git status

duplicate remote tracking

# inspect
find .git/refs/remotes -type f -name '* 2*' -print
# delete duplicated then
git fetch --prune

Tiny Git goblin note

Never edit/delete random files inside .git casually,
but these icloud 2 duplicate ref files are exactly the kind of iCloud ghost files we can safely remove.

Git Submodules > Troubleshooting

Recover Orphan Detached Commits