问题描述
我的安装程序如下所示:
我的根目录中的裸回购 / srv
文件夹
本地回购在我的PC上
$ b Gitlab回购 Gitlab
我添加了两个来源(Gitlab和我的裸回购),以将所有更改从本地计算机推送到源代码。
现在我想在我的 Bare Repo 中设置一个post-receive Hook,因此它会更新我的VSP上的工作目录( Bare Repo )
但是我之前已经开发出没有git(所有的文件都是一样的),我不想在另一个目录中克隆Repo,只是将 .git
文件夹添加到我的 var / www / project
。
这可能与git?
或者有没有干净的方法克隆Repo和更改文件夹?
通常,您使用设置在裸仓库中,以将所述仓库结帐到目的地文件夹中:
git --git-dir = /path/to/project_root/.git --work-tree = / var / www / project / checkout -f
My Setup looks like this:
Bare Repo in my Root /srv
Folder
Local Repo on my PC
Gitlab Repo on well Gitlab
I added two origins (Gitlab and my Bare Repo) to push all changes from my local machine to the source.
Now I want to set up a post-receive Hook in my Bare Repo so it will update the working directory on my VSP (where the Bare Repo lies)
But I already developed before without git (all the files are the same), I don´t want to clone the Repo in another directory, but just add the .git
Folder to my var/www/project
.
Is that possible with git?
Or is there no clean way around cloning the Repo and change folders?
Usually, you use the post-receive
hook set in the bare repo to checkout said repo into the destination folder:
git --git-dir=/path/to/project_root/.git --work-tree=/var/www/project/ checkout -f
这篇关于将git存储库添加到VSP上的现有文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!