git push return "Error: cannot lock existing info/refs"

Bug #293553 reported by Moisés Rodríguez Carmona on 2008-11-04
This bug affects 1 person
Affects Status Importance Assigned to Milestone
git-core (Ubuntu)

Bug Description

Binary package hint: git-core

When I make a "git push", it returns "Error: cannot lock existing info/refs". I'm working with a server about webdav protocol.My system's administrator say that git push don't send lock command.

I'm using Ubuntu 8.10

P.D: Sorry but english is not my first language.

Benjamin Bach (benjaoming) wrote :

You probably need to add and edit ~/.netrc

In the file, you should put hostname, username and password like this:

username foo
password bar

I had the same issue. It's not a bug, just something that's pretty badly documented and seems to have caused people a lot of headaches.

Benjamin Bach (benjaoming) wrote :

Sry. Not like that. Like this:

login foo
password bar

I have the same problem with git and webdav. While .netrc solution provides a workaround (thanks for the hint), isn't it a bit unsatisfying? On OS X, git asks for my password, so I did not have to use .netrc. On ubuntu at first I tried supplying basic auth info in the url (user:password@url) which led to the error described here. And that workaround also has me putting my password into a file in clear text.

Also man netrc states that netrc was intended for ftp. I don't really like putting my password into a file that is readable system wide.

arnuschky (abrutschy) wrote :

This does not work anymore with karmic. Git always asks me for my password. Can anyone confirm this?

arnuschky, I got the same problem as you did, so I removed the username from the .git/config URL, i.e., instead of

[remote "upload"]
        url = https://nuno@

i have now:

[remote "upload"]
        url =

(running lucid here)

mio75 (mio75) wrote :

This error message can actually stem from a stale lock file, e. g. after a previous git push died of a signal.
In this case, it will help to delete /var/lock/apache2/DavLock on the server.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers