Permission denied for git init

烂漫一生 提交于 2019-12-08 12:24:48

问题


git init can't run in /var/www/html/wp I do as Ding says in the web.

usermod -a -G www-data username

usermod -a -G www-data debian8

It takes no effect at all.
Why can't I run git init in my /var/www/html/wp?


回答1:


You can also change the umask in your .profile in your home directory:

# the default umask is set in /etc/profile; for setting the umask
# for ssh logins, install and configure the libpam-umask package.
# umask 022
umask 002

What this does is set the initial perms for any new directories or files that you create.

New directories will get 775 (drwxrwxr-x), vs default 755 (drwxr-xr-x). Files will get 664 (-rw-rw-r--), vs default 644 (-rw-r--r--).

Depending on your situation, you may want to change it back after running git init.




回答2:


sudo chmod -R g+w /var/www/html/wp



来源:https://stackoverflow.com/questions/41546140/permission-denied-for-git-init

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!