git部署项目 - 文件权限 - (chmod) [英] git deploying project - file permissions - (chmod)

查看:185
本文介绍了git部署项目 - 文件权限 - (chmod)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用 git 将项目部署到使用post-update挂钩的远程服务器上。更具体地说,我遵循这些步骤。但是,在使用 git push production 进行部署后,我的本地副本上的所有内容都具有正确的权限,设置为 777 在远程服务器上更改为 -rwxr-xr-x



我已经添加到本地/远程) .git / config 核心变量 filemode = false 我也改变了我的umask在 / etc / profile 0002



文件的模式?感谢

解决方案

core.filemode 索引。当git检出文件时,无条件地使用存储模式,文件只能有644或755的模式。修改你的post-checkout钩子来chmod文件。


I'm deploying my project with git to a remote server using a post-update hook. More specifically I'm following these steps. Everything on my local copy has the right permissions, however after deploying with git push production, files that are set to 777 change in the remote server to -rwxr-xr-x

I've added to both (local/remote) .git/config the core variables filemode = false and I've changed as well my umask in /etc/profile to 0002

Any ideas why it keeps changing the mode of files? Thanks

解决方案

The core.filemode variable is only used when files are indexed. When git checks out files, the stored mode is used unconditionally, and files can only have a mode of 644 or 755. Modify your post-checkout hook to chmod the files.

这篇关于git部署项目 - 文件权限 - (chmod)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆