【发布时间】:2015-03-20 08:35:23
【问题描述】:
给定一个裸存储库,我可以在 post-receive 挂钩中使用 git --work-tree=/path/to/folder --git-dir=/path/to/bare.git checkout -f 将头部检出到 folder,而无需在其中包含 .git 文件夹。当folder 位于远程机器上时,我该如何做到这一点?
我知道git clone --depth=1,但我不能使用它,因为远程文件夹可能已经存在。 rsync [--delete] 也不是一个选项,因为我想要每个文件夹的本地文件,但不在 repo 中(例如,所有文件夹都包含不同的 confi.local.ini)。
【问题讨论】: