发布Jekyll站点到Git仓库 [英] Publish Jekyll Site To Git Repository
问题描述
p>您可以在其他地方(即不在受Jekyll部署影响的目录中)
GIT_WORK_TREE
变量,目标文件夹为值
换句话说,在工作树目录本身中不一定需要 .git
。
它可以在其他地方,脚本可以通过 GIT_WORK_TREE
或通过 - 工作树=<路径>来引用实际工作树;
选项。
如果您的脚本是Jenkyll复制/擦除文件的目标目录的一部分,则可以做相反的操作, .git
实际上与 GIT_DIR
变量或 - gi t-dir =< path>
选项。
要新建 - work-dir
作为你的仓库的默认选项,你可以使用 git-config --add core.worktree ../ PATH /
,其中 PATH
- 实际工作目录相对于 .git
的路径。
Every time I run Jekyll it destroys the entire contents of the destination folder. The problem with this is that my destination directory is a small git repo from which I use to push to my actual server. Is there a way to stop Jekyll deleting the Git files so that I don't have to generate the contents then copy them over?
You could have:
- your git repo elsewhere (i.e. not in the directory affected by a Jekyll deployment)
- have your script pushing that git repo to your server specify a
GIT_WORK_TREE
variable with the destination folder as value
In other words, a .git
don't have to be necessary in the working tree directory itself.
It can be elsewhere, and your script can refer to the actual working tree through GIT_WORK_TREE
or through a --work-tree=<path>
option.
If your script is part of the destination directory where Jenkyll copies/erases files, you can do the opposite, and mention where the .git
actually is with GIT_DIR
variable or with --git-dir=<path>
option.
To have new --work-dir
as default options to your repo, you can use git-config --add core.worktree ../PATH/
, where PATH
- path to actual working directory relative to .git
.
这篇关于发布Jekyll站点到Git仓库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!