Nathan Gross
Nathan Gross

Reputation: 118

git init Permission denied - /private/etc/apache2

On OS X 10.10, I would like to use git with my apache in private/etc/apache2 directory. When I try to run git init I get Permission denied. What would a best practice be to add the appropriate permissions on this directory to enable git usage?

Upvotes: 1

Views: 2324

Answers (2)

royki
royki

Reputation: 1693

As it is about to Permission Denied and @mu also mentioned about to use the sudo command,

Give the permission of the folder to the user by the following command -

$ chmod u+x /private/etc/apache2

Upvotes: 0

Anshul Goyal
Anshul Goyal

Reputation: 77053

The Permission denied is generally a file permission issue, where git doesn't have permissions to write.

One option is to run your git init etc with sudo, i.e., as sudo git init (though this is not recommended)

You could also create a new user and a new group, add your web server user to that group and initiate git init with this user. Another alternative is to add yourself to the apache group using usermod

Upvotes: 3

Related Questions