Today, I was updating an old git repository but when I tried to delete some branches in my local environment and in the remote, I received this kind
“remote ref does not exist”
And that is because some remote branches didn’t exist anymore.
In order to update the references in our local machine we can use the git fetch command in this format:
git fetch -p MY_REMOTE // Example git fetch -p origin
From Stack Overflow:
-p option tells fetch to delete any tracking branches that no longer exist in the corresponding remotes; by default they are kept around”.
That’s it for today enjoy your work!
Añade un Comentario
One comment on “SOLVED: Git remote ref does not exist when trying to delete branches”
Thanks Alex – great tip ! Exactly what I was looking for.