Unix & Linux Stack Exchange is a question and answer site for users of Linux, FreeBSD and other Un*x-like operating systems. 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

I have a development machine that use runs on CentOs.

Whenever i pull from git using git pull i get "permission denied" issue/error.

Git apparently doesn't have the permission to overwrite the files needed when i do a pull. Thus after every time i have to sudo git pull to get it to work.

I would rather not do a sudo git pull because i'd like everyone to be able to pull from our development server.

How do i configure git to have the proper permissions to just be able to pull without sudoing? Is this because I may have not configured git properly? If so how do i configure git to allow the correct permissions?

Not sure if this helps but a which git reveals this:


Example error

i execute: git commit -m "my fun message" i get:

error: Unable to append to .git/logs/refs/heads/stage: Permission denied fatal: cannot update HEAD ref

share|improve this question
“Permission denied” from what? Is the repository local or remote? What are the permissions on the repository? – Gilles Jul 19 '11 at 20:47
Good point. I've updated my question – chrisjlee Jul 19 '11 at 20:54
up vote 6 down vote accepted

Git itself doesn't have any permissions. It relies entirely on the operating system level permissions.

If you're the only person using that git repo, then do this:

cd dir_of_repo
sudo chown -R ${LOGNAME} $(pwd)
sudo chmod -R u+rwX $(pwd)

If you're sharing this with other people, then you probably need to read Understanding UNIX permissions and chmod.

share|improve this answer
What do those commands do? – chrisjlee Jul 20 '11 at 0:07
You should read that link that I already posted. Those commands make you the owner and give you full permission over the repo directory. – bahamat Jul 20 '11 at 12:59

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.