Git 版本控制 - 存储库视图?
我有一个存储库,我想要有两个“视图”:开发人员可以看到整个事情,而客户应该只看到某些(标记或以其他方式标记)分支。
我考虑过制作两个存储库 A 和 B,然后将所有不需要的文件列为 B 中的“忽略文件”,但我不确定这是否可行。 (我不知道A是否同步B的忽略文件,可能有人知道可以回答吗?)
因此我认为如果我可以在上进行“视图”(仅显示标签X..),那就太酷了存储库,或者类似的东西可以解决我的问题,但据我所知,这在 git 中是不可能的。
亲切的问候
I have a repositories, i want to have two "views": Developers can see the whole thing and customers should only see certain (tagged, or marked in another way) branches.
I thought about making two repsoitories A and B and than list all not needed files as "ignored files" in B but I am not sure whether this will work. (I don't know whether A syncs B's ignored files or not, may be some one who knows that can answer?)
Thus I thought it would be cool if i I could make "views" (show only tags X..) on the repository, or something similar which solves my problem, but afaik this is not possbile in git.
kind regards
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
git 中的分支是本地的。
您可以在本地拥有任意数量的分支,并仅将相关分支推送到相关存储库。
替代文本 http://nvie。 com/wp-content/uploads/2009/12/Screen-shot-2009-12-24-at-11.32.03.png
上面的图片来自 http://nvie.com/git-model 是一个很好的工作流程,其中开发人员有许多分支,但仅推送开发分支,同样生产服务器只有主分支。
Branches in git are local.
You can have any number of branches locally and push only the relevant ones to the relevant repositories.
alt text http://nvie.com/wp-content/uploads/2009/12/Screen-shot-2009-12-24-at-11.32.03.png
The image above from http://nvie.com/git-model is a good workflow, in which developers have many branches but push only the develop branch and similarly the production server has only the master branch.
您可以使用 gitosis,甚至可以使用 gitolite 访问每个标签或分支。
You can manage access per repository with gitosis, and even access per tag or branch with gitolite.
您只需要一个克隆存储库。在这个另一个存储库中,您可以仅推送您想要的标签以及您想要的提交中的分支。
You just need a clone repository. In this other repository you can push only your tag that you want and branches that you want in commit that you want.