简体   繁体   English

git push和服务器权限

[英]git push and server permissions

I've a LAMP environment on my VPS where I would like to set up a versioning system. 我的VPS上有一个LAMP环境,我想在其中建立一个版本控制系统。 I'm using git and right now I did in order these things: 我正在使用git,现在我按以下顺序进行操作:

  • I created a git user and its relative home in /home/git 我在/home/git创建了一个git用户及其相对首页
  • I created /var/git folder where I'm storing all --bare repositories 我创建了/var/git文件夹,用于存储所有--bare信息库
  • I created my working directory in /var/www/myproject initialized with git init and linked with git remote add hub to my bare directory 我在/var/www/myproject创建了我的工作目录,并使用git init初始化,并使用git remote add hub链接到了我的裸目录
  • I created inside /var/git/myproject.git/hooks a post-update that pulls files into my working directory in /var/wwww/myproject 我在/var/git/myproject.git/hooks内部/var/git/myproject.git/hooks了一个后期更新,该更新将文件拉入/var/wwww/myproject工作目录中

Now my problem is that my /var/www and all subdirectories are assigned to the www-data user and group and with these everything works like a charm but after a pull or an init from git things have as user and group git:git and permission of course breaks in ftp, web installers etc. 现在我的问题是我的/var/www和所有子目录都分配给了www-data用户和组,并且所有这些都像魅力一样工作,但是从git中拉出或初始化后,事物又成为了用户和组git:git和ftp,网络安装程序等当然会中断

Any one have an idea on how to proceed at this point? 在这一点上,有人对如何进行有想法吗? many thanks. 非常感谢。

将git用户添加到www-data组: sudo usermod -a -G www-data git应该有所帮助-有关更多信息,请访问http://machiine.com/2013/easy-way-to-give-user-permission-to -edit-和添加文件正在varwww /

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM