git clone produces different permissions on different servers

一个人想着一个人 提交于 2019-12-10 23:32:34

问题


When doing a git clone git://github.com/blasto333/PHP-Point-Of-Sale.git on one server the files permissions are (I am showing one file but it is like this for all of them):

-rw-r--r--  1 chrism chrism   3297 Apr  1 19:12 index.php

On the second server it is:

-rw-rw-r--  1 rrdiaper rrdiaper   3297 Apr  1 19:14 index.php

On a third server it is:

-rw-r--r--@  1 cmuench  cmuench    3297 Sep 17  2010 index.php

The 2nd server is complaining because the file is group writable (php suExec). I know I can fix it with a chmod -R 644, but I would rather understand why permissions are different.


回答1:


Check your umask. http://www.cyberciti.biz/tips/understanding-linux-unix-umask-value-usage.html




回答2:


I dont know, how you can find it out, but I assume, that on the second server the repository is created with --shared=group. This will (as it suggests) make the repository shared with the group and so it sets the appropriate settings, that allows users in the same group to push to the repository.



来源:https://stackoverflow.com/questions/5519864/git-clone-produces-different-permissions-on-different-servers

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