简体   繁体   English

如何将文件输出设置到服务器上远程git裸存储库的目录?

[英]How can I set an output of files to a directory on the server for a remote git bare repository?

I have installed git on the server. 我已经在服务器上安装了git。 There are already plenty of files in the project directory (www/beta/httpdocs). 项目目录(www / beta / httpdocs)中已经有很多文件。 I want to setup a remote bare repository where I and a few people could push to. 我想建立一个远程裸仓库,我和几个人都可以推送到该仓库。

We want to connect that repo to a directory in the wwwroot so that when someone pushes their files to the repo, the files are automatically copied to the wwwroot of our beta domain (beta.server.com) where we could test for bugs. 我们希望将该仓库连接到wwwroot中的目录,以便当有人将其文件推送到仓库时,文件会自动复制到我们的Beta域(beta.server.com)的wwwroot中,我们可以在其中测试错误。 When we are satisfied with the quality, I would copy the files to the main domain (which is on the same server, just in another directory) manually, or if I find another more profound way. 当我们对质量感到满意时,我会手动将文件复制到主域(位于同一服务器上,位于另一个目录中),或者如果我找到另一种更深刻的方法,则将其复制到主域。

It's very important that I somehow add these already existing files on the server to the bare repo. 我以某种方式将服务器上已经存在的这些文件添加到裸仓库很重要。

first, to add the current files, git init then setup a remote branch to push to. 首先,要添加当前文件,请使用git init然后设置要推送到的远程分支。 Then on your server setup a post-receive hook that runs a deploy off to your service, basically triggering a git pull 然后在您的服务器上设置一个post-receive挂钩,该挂钩将对您的服务进行部署,基本上触发了git pull

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

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