gpt4 book ai didi

linux - git pull 后,git pull 到 www 文件夹

转载 作者:太空宇宙 更新时间:2023-11-04 04:07:28 26 4
gpt4 key购买 nike

我想在推送后将代码从 GIT 拉取到虚拟主机目录。问题是 commit hook 以 git 用户身份运行,但 apache 上的虚拟目录文件夹位于 www-data:www-data 下。

是否有可能以 www-data(shell 脚本,包括 git pull 和一些用于临时的 rm 内容)而不是 git 用户身份运行脚本?

谢谢马丁。

最佳答案

虽然可以使用 sudo 并定义特定命令,但我建议不要这样做:这种设置听起来很容易配置错误或破坏。

我建议您让 cron 作业每隔几分钟运行一次 git pull

关于linux - git pull 后,git pull 到 www 文件夹,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20610035/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com