Git pulling without root access

17,687

Solution 1

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.

Solution 2

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:
17,687

Related videos on Youtube

JJJollyjim
Author by

JJJollyjim

Updated on September 18, 2022

Comments

  • JJJollyjim
    JJJollyjim over 1 year

    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.