Back

Explore Courses Blog Tutorials Interview Questions
+1 vote
2 views
in DevOps and Agile by (19.7k points)

After cloning from the remote git repository (at better codes) I made some changes, committed 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:

  1. git config –global http.sslVerify false
  2. git init
  3. git remote add [url]
  4. git clone
  5. change data
  6. 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.

1 Answer

+2 votes
by (62.9k points)

For me this worked:

git remote prune origin

What this will do is it removes 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 remotely, but it will update the local references you have to remote branches. It seems in some cases these references may have data Git cannot handle correctly.

Browse Categories

...