After cloning from remote git repository (at bettercodes) I made some changes, commited and tried to push:
git push origin master
Errors with:
error: cannot lock existing info/refs
fatal: git-http-push failed
This case regards already existing repository.
What I did before, was:
git config –global http.sslVerify false
git init
git remote add [url]
git clone
git commit
At 'bettercodes' I have no access to git log.
I'm using Windows. The detailed error was:
C:\MyWorkStuff\Projects\Ruby\MyProject\>git push origin master Unable to create branch path https://user:[email protected]/myproject/info/ error: cannot lock existing info/refs fatal: git-http-push failed
I cloned before, then changed the code and committed.
If you get a failed to push some refs to error, the main thing to do is git pull to bring your local repo up to date with the remote. Avoid employing the --force flag when using git pull and prevent other developers' accidental overwrites of committed features.
The git prune command is an internal housekeeping utility that cleans up unreachable or "orphaned" Git objects. Unreachable objects are those that are inaccessible by any refs. Any commit that cannot be accessed through a branch or tag is considered unreachable. git prune is generally not executed directly.
For me this worked (won't change in remote):
git remote prune origin
Since this answer seems to help a lot of people, I dug a little bit into what actually happens here. What this will do is remove references to remote branches in the folder .git/refs/remotes/origin
.
So this will not affect your local branches and it will not change anything remote, but it will update the local references you have to remote branches. It seems in some cases these references can contain data Git cannot handle correctly.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With