Git无法创建文件权限被拒绝 [英] Git unable to create file permission denied
问题描述
我使用Amazon EC2来托管通过git部署到服务器的网站。我以前在同一种EC2 Ubuntu Linux Server实例中使用了本教程,并且它的工作完美无瑕。但是,当我尝试推送到服务器时,我收到以下错误跟踪:
教程: http://toroid.org/ams/git-website-howto
跟踪:
$ git push origin master
计数对象:5,完成。
写入对象:100%(3/3),250字节,完成。
共3(delta 0),重用0(delta 0)
remote:错误:无法创建文件index.html(权限被拒绝)
至ssh://ubuntu@myserv.er /var/www/website.git
8068aac..04eae11 master - > master
目前版本库中只有一个文件,它是的index.html
。
错误跟踪显示权限被拒绝创建文件。请问你能告诉我我哪里出错了吗?
你可能没有做过这部分教程:首先,上面的工作树(/var/www/www.example.org)必须可以由运行钩子的用户写入(或者用户需要使用sudo访问来运行git checkout -f或类似的东西)。
I am using Amazon EC2 to host a website which is deployed to the server via git. I used this tutorial previously on the same kind of EC2 Ubuntu Linux Server instance, and it has worked flawlessly. However, when I try and push to the server, I receive the following error trace:
Tutorial: http://toroid.org/ams/git-website-howto
Trace:
$ git push origin master
Counting objects: 5, done.
Writing objects: 100% (3/3), 250 bytes, done.
Total 3 (delta 0), reused 0 (delta 0)
remote: error: unable to create file index.html (Permission denied)
To ssh://ubuntu@myserv.er/var/www/website.git
8068aac..04eae11 master -> master
I only have one file inside the repository at the moment, which is index.html
.
The error trace is showing that the permission is being denied to create the file. Please can you tell me where I am going wrong?
You probably didn't do this part of the tutorial:
First, the work tree (/var/www/www.example.org above) must be writable by the user who runs the hook (or the user needs sudo access to run git checkout -f, or something similar).
这篇关于Git无法创建文件权限被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!