[英]git change permission failed to persist before next commit
I need to set the permission of script.sh to 755
. 我需要将script.sh的权限设置为
755
。 So 所以
git add -A
git update-index --chmod=+x script.sh
git commit -m 'first commit'
This way the file will be committed with a permission 755
and my remote vm can execute those scripts. 这样,文件将以权限
755
提交,我的远程vm可以执行那些脚本。
However, next time I do something to the repo and commit the changes the permission of those scripts will be reverted to 644
. 但是,下次我对存储库执行某些操作并提交更改时,这些脚本的权限将恢复为
644
。 The message is 消息是
[master 171c0cc] second
2 files changed, 1 insertion(+)
mode change 100755 => 100644 script.sh
Anyone know what might be happening here? 有人知道这里会发生什么吗? How do I get rid of this?
我该如何摆脱呢?
First check your git config core.fileMode
: if it is set to false, the executable bit of files in the working tree won't be honored anyway. 首先检查您的
git config core.fileMode
:如果将其设置为false,则无论如何都不会接受工作树中文件的可执行位。
If it is true or not set, then try a chmod . 如果为true或未设置,请尝试使用chmod 。
Then try also to set core.sharedRepository
to group
. 然后尝试将
core.sharedRepository
设置为group
。
And check your umask. 并检查您的umask。
umask 002
in your case should work. 您的情况下的
umask 002
应该可以工作。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.