Git分支实验 [英] Git branch experiment

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

问题描述

这是一个使用Git的有趣实验。想想Github的'网页'功能:我在一个分支中编写程序(例如 master ),文档网站保存在另一个完全不相关的分支中(例如<$ c

我可以从我的 master 中的代码生成HTML格式的文档, / code> -branch,但我想将它作为我的文档网站的 gh-pages 分支中的一部分发布。



我怎样才能从 master 中的代码智能地生成我的文档,并将它移动到我的 gh-pages 分支并提交更改?我应该使用post-commit钩子还是什么?这是一个好主意,还是完全愚蠢?

解决方案

在版本控制下生成文件有什么好处?如果你坚持这样做,在同一个存储库中生成和生成文件有什么好处? git的分支支持非常棒,但我相信它不是设计用来做你正在尝试做的事。


Here's an interesting experiment with using Git. Think of Github's ‘pages’ feature: I write a program in one branch (e.g. master), and a documentation website is kept in another, entirely unrelated branch (e.g. gh-pages).

I can generate documentation in HTML format from the code in my master-branch, but I want to publish this as part of my documentation website in the gh-pages branch.

How could I intelligently generate my docs from my code in master, move it to my gh-pages branch and commit the changes there? Should I use a post-commit hook or something? Would this be a good idea, or is it utterly foolish?

解决方案

What would be the advantage of having generated files under version control? And if you insist on this, what would be the advantage of having generating and generated files in the same repository? git's branching support is fantastic, but I am sure it wasn't designed to do what you are trying to do.

这篇关于Git分支实验的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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