Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

On a Ubuntu Server 10.10 box, I seem to require root access to use git pull (in my /var/www directory). error: cannot open .git/FETCH_HEAD: Permission denied.

I have tried chmodding 0777 /var/www and /var/www/.git, and chowning both of these to my account, to no avail.

share|improve this question

The error message is not about /var/www or /var/www/.git. It is about /var/www/.git/FETCH_HEAD, which you need write permissions on.

share|improve this answer

For whatever reason, you do not have access to the local file .git/FETCH_HEAD .

The solution to this is to run chown -R youruser .git/

Once you run this, you should be able to run it without the sudo.

share|improve this answer

You'll probably need permissions on the whole directory and all the files to be able to pull.

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .