Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
333 views
in Technique[技术] by (71.8m points)

git 回退版本,为啥部分文件的所有者从apache变为root了 ?

image

image


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

你用 root 用户执行的.

我的建议是,如果你这个目录必须是 apache 的用户权限,那么你对整个目录先设置下权限 chown -R apache:apache public 然后每次执行 git 命令都用 apache 的用户执行 sudo -u apache git reset --hard 977e75b


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...