Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Git 将dist子树推送到GH页面_Git_Maven_Github - Fatal编程技术网

Git 将dist子树推送到GH页面

Git 将dist子树推送到GH页面,git,maven,github,Git,Maven,Github,我正在尝试自动化构建链,将生成的文档推送到github gh页面。 以下是工作流程: Jenkins将远程源签出到本地主分支。 它在本地构建项目(生成二进制到目标/暂存,例如mvn站点:暂存) 然后我有一个shell post步骤: git push origin --delete gh-pages #removes the existing remote gh-pages branch git checkout -b gh-pages # creates a local gh-page bra

我正在尝试自动化构建链,将生成的文档推送到github gh页面。 以下是工作流程: Jenkins将远程源签出到本地主分支。 它在本地构建项目(生成二进制到目标/暂存,例如mvn站点:暂存)

然后我有一个shell post步骤:

git push origin --delete gh-pages #removes the existing remote gh-pages branch
git checkout -b gh-pages # creates a local gh-page branch
git rm -rf . #untrack everything
git add target/staging #adds the generated doc to tracking
git commit -am "Added staging" commit changes
git subtree split --prefix target/staging -b gh-pages #subtree branch to gh-pages branch
所以,我以为是这样的,但一个奇怪的“分支”gh pages“不是commit的祖先…”击中了我的脸

有没有人能够在远程github banch中推送此子树的解决方案

先谢谢你


免责声明,我测试了github站点插件和scm publisher,但我的站点中有太多的文件用于这些插件…

我在github上找到了一个很好的shell,它可以做到这一点:


但是,我始终希望得到一个内联答案:)

看起来您忘记删除本地
gh页面了
分支:

$ git branch -D gh-pages