跨分支参考可能吗? [英] Is cross-branch reference possible?

查看:80
本文介绍了跨分支参考可能吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Github上有个人项目。我的主要文档是我的主分支中的一些文本文件,我自动从它们生成一些HTML页面。
Github将回购网页保存在一个名为gh-pages的独立分支中。我希望该页面可以引用我生成的html文件。
是否可以在另一个分支上硬链接/导入文件,以便当我在master中更改文档并重新绑定html文件时,gh-pages分支也是最新的?

解决方案

您有两点不同: - 生成的文件必须放入git存储库。

  • 第二,您希望将它们放在另一个分支中。



  • 我认为有两个本地存储库跟踪两个分支( master gh-pages ),并让您的生成过程将生成的主文件放入 gh-pages 的工作目录中。然后在第二个仓库中使用一系列git add,git commit和git push来更新在线gh-pages。






    <实际上,我只是尝试了这个,没有两个完整的本地存储库,但是一个存储库有两个工作目录,使用 GIT-新WORKDIR 。然后从master / javadoc到gh-pages / javadoc创建一个符号链接(不是版本控制,但是被忽略),以在正确的位置创建文档。

    (结果是我的 jsch-documentation 资源库。)


    I have a personal project on Github. My main documentation is a bunch of text files in my master branch, and I automatically generate some HTML pages from them. Github keeps the webpage for the repo in a separate branch called gh-pages. I want that page to refer my generated html files. Is it possible to hardlink/import a file on an another branch, so that when I change my docs in master and rebiuld the html files, gh-pages branch is also up to date?

    解决方案

    You have two different points here:

    • first, auto-generated files have to be put into the git repository.
    • second, you want to have them in another branch.

    My take would be to have two local repositories tracking both branches (master and gh-pages), and let your generating process put the generated files from master into the working directory of gh-pages. Then use a series of git add, git commit and git push in the second repository to have the online gh-pages updated.


    Actually, I just tried this, with not two complete local repositories, but one repository with two working directories, using git-new-workdir. Then a symlink (not versioned, but ignored) from master/javadoc to gh-pages/javadoc), to create the documentation at the right location.

    (The result is my jsch-documentation repository.)

    这篇关于跨分支参考可能吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆