Server Fault is a question and answer site for system and network administrators. 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 am trying to initiate git on my remote server using ssh. When I run

git init

On the server in a folder I have write permissions to I get the following error.

.git: Permission denied

Do I need to assign any other permissions on that folder to be able to create the repository?


share|improve this question

migrated from Apr 20 '10 at 3:56

This question came from our site for professional and enthusiast programmers.

You need rwx rights for the directory you're running git init in. Check also that there is no .git directory already existing in that directory (ls -la) and that there are suitable permissions (if you're initializing, then just remove that directory).

Alternatively check the $HOME/.git directory permissions for being funky, but there shouldn't be anything special there.

share|improve this answer
thanks, it pointed me in the right direction. more specifically the problem was the folder was owned by another user who had the correct perms and my user had write access but not the perms u suggested. Changing the user to my user gave me the perms u suggest! thanks! – Gcoop Apr 19 '10 at 9:57
  1. Check that the .git folder doesn't already exist.

  2. To make sure you really have the correct permissions, note down the current permissions and then do a chmod a+wx .. If it works afterwards, remove permissions until it breaks.

share|improve this answer


  • sudo chmod -R 777 /home/.git

  • cd /home/.git

  • Now try Executing the git command

As long as you are on linux, do NOT forget sudo (your best friend)


share|improve this answer
777 is not a really good idea, a fix maybe but not a good idea in general – OliverS Apr 20 '10 at 9:38
Works on Windows in Git bash shell. I think it is okay to 777 on the .git directory itself if you are going to delete it, because it will no longer exist. – Travis Pessetto Jun 6 '12 at 18:21

Your Answer


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