I get the following error when I try to git push
a branch documentation/manifest
:
error: update_ref failed for ref 'refs/remotes/origin/documentation/manifest': cannot lock ref 'refs/remotes/origin/documentation/manifest': 'refs/remotes/origin/documentation' exists; cannot create 'refs/remotes/origin/documentation/manifest'
The steps which led up to this error were:
- cloned from the remote repo (github)
- created a local branch
documentation/manifest
and did some work on it, committing the work. - pushed the branch. Couldn't push because there was an existing 3 year old, stale, branch called
documentation
. - Deleted the branch
documentation
on github. - pushed again. Branch pushed OK to remote, I can confirm it is there, however the above error appears after every time I push. Given that I presume it is a local error.
I've looked up some similar questions such as Git error when pushing - update_ref failed, however this was dealing with a different cause - it was not clear to me if the suggested solutions to that answer would help in this case, and as they seemed quite low-level they could equally well mess things up in a different way.
So, what do I need to do to get rid of this error whenever I push this branch?