how to resolve cannot lock refs git error
error
hams@Venom zen-litter-box % git fetch
error: cannot lock ref 'refs/remotes/origin/dev/notes-details': 'refs/remotes/origin/dev' exists; cannot create 'refs/remotes/origin/dev/notes-details'
From https://github.com/Ha-So/zen-litter-box
! [new branch] dev/notes-details -> origin/dev/notes-details (unable to update local ref)
error: cannot lock ref 'refs/remotes/origin/dev/notes-tags': 'refs/remotes/origin/dev' exists; cannot create 'refs/remotes/origin/dev/notes-tags'
! [new branch] dev/notes-tags -> origin/dev/notes-tags (unable to update local ref)
solution
git remote prune origin
reason
This command removes references to remote branches in the folder .git/refs/remotes/origin.