简体   繁体   中英

Cannot mkdir with git clone

Once I clone my repo, the folders don't have write access, and so my PHP code cannot use mkdir() to make a folder if it needs to.

I get this error: mkdir(): Permission denied

Why is this? In my repo I have a pages folder, which has the following permissions after I git clone it to my /var/www/html folder.

drwxr-xr-x 4 me me 4.0K Jun 9 18:30 pages

Is this set in the repo itself? Or is there some command I can add to git clone that will allow me to fix this?

The only file permission that is tracked and handled by Git is the executable bit. Everything else is not tracked and not controlled by Git. This is one of the arguments against using Git as a deployment tool which it is not. You can find some hints on how you can utilize Git to make a deployment strategy at http://gitolite.com/deploy.html . The permssions of the files after cloning are simply the default on your linux system. You can change this in your linux environment to be something different.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM