如何使用Git使用Kiln管理分支机构? [英] How to manage branches with Kiln using Git?

查看:67
本文介绍了如何使用Git使用Kiln管理分支机构?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的公司正在使用Kiln,因此开发人员可以在Git和Mercurial之间使用他们偏爱的工具.我是Git用户,从未使用Mercurial.

My company is using Kiln so developers can use their preferred tool between Git and Mercurial. I’m a Git user and never used Mercurial.

对窑炉使用分支机构有一些不理解.实际上,当我使用Kiln接口创建新分支时,它会创建一个新的存储库,而不是分支.即使Kiln将其显示为分支"而不是存储库".当我在Git中克隆存储库时, git branch -a 不会显示我刚刚创建的远程分支.我需要独立克隆每个伪分支.

There are some incomprehensions in the use of branches with Kiln. When I create a new branch using the Kiln interface, it, in reality, creates a new repository, not a branch. Even if Kiln displays it as a "branch" and not a "repository". And when I clone the repository in Git, git branch -a does not show me the remote branch I just created. I need to clone every pseudo-branch independently.

另一方面,如果我在Git中创建一个分支并将其推送到远程,则它不会在Kiln上创建分支,而是在所有分支中可见某种称为头"的子分支".很混乱.但是,显然没有办法通过Kiln界面创建与Git完美配合的子分支".我也不知道他们在Mercurial上是否运作良好.

On the other side, if I create a branch in Git and push it to the remote, it does not create a branch on Kiln but some kind of "sub-branch" called a "head" visible in all branches. Very confusing. But there is apparently no way to create these "sub-branch" that work perfectly with Git via the Kiln interface. I also don't know if they work well on Mercurial.

$ git branch -a
* master
  remotes/origin/HEAD -> origin/master
  remotes/origin/feature2
  remotes/origin/master

我坚信这与窑的亲Mercurial哲学"有关.我对Mercurial进行了一些研究,发现分支系统与Git完全不同.克隆存储库以创建分支是正常的,而在Git中则是无意义的.Mercurial还具有无法删除的命名分支",并且窑炉开发商不鼓励使用它们.我的子支行"实际上可以称为命名支行"吗?问题是我可以使用 git push origin:sub-branch 删除那些子分支".

I’m convinced this is related to the pro-Mercurial "philosophy" of Kiln. I made some researches on Mercurial and find out that the branch system is completely different from Git. It is normal to clone the repository to create a branch while in Git it is non-sense. Mercurial has also "named branches" which cannot be deleted and their use is discouraged by the Kiln developers. Can my "sub-branches" be actually "named branches"? The problem is that I can delete those "sub-branches" using git push origin :sub-branch.

答案必须是显而易见的,因为分支是Mercurial和Git的重要特征,而Kiln必须使用两种工具完成分支工作的简单而优雅的方法.但是我无法弄清窑炉的逻辑.恐怕Kiln可能对Mercurial太友好了,而Git的支持可能更像是黑客.

The answer must be obvious since branching is an important features of both Mercurial and Git and Kiln must have done a simple and elegant way of doing branch working using both tools. But I’m unable to figure out the logic of Kiln. I’m afraid Kiln may be too Mercurial-friendly and that the Git support may be more like a hack.

推荐答案

在Kiln UI上,当您创建分支时,它是克隆分支",而不是Mercurial命名分支.

On the Kiln UI, when you create a branch, it is a "clone branch", not a Mercurial named branch.

如果您在Mercurial中使用命名分支,它们将自动转换为Git分支.但是,当您提交到Git分支时,它不会在Mercurial中转换回相同的命名分支.窑队必须找出Git分支到Git到Merurial的最佳翻译,他们决定以Mercurial的书签"为最佳.因此,当您推送到Git分支时,它将更新或创建相应的Mercurial书签( https://www.mercurial-scm.org/书签 http://mercurial.aragost.com/kick-start/en/bookmarks/)具有相同的Git分支名称,并且该书签将位于Mercurial中的默认"分支上.我将与使用Mercurial的团队成员进行核对,以查看将书签用作Git分支的模拟对象是否对他们有用.

If you use named branches in Mercurial, they will be automatically translated to Git branches. However, when you commit to the Git branch it will not convert back to the same named branch in Mercurial. The Kiln Team had to figure out the best analogue for the Git-to-Mercurial translation of Git branches, and they decided that a Mercurial 'bookmark' works the best. So when you push to a Git branch it will update or create a corresponding Mercurial bookmark (https://www.mercurial-scm.org/Bookmarks, http://mercurial.aragost.com/kick-start/en/bookmarks/) with the same Git branch name, and that bookmark will be on the 'default' branch in Mercurial. I'd check with the members of your team that use Mercurial to see if using bookmarks as an analogue to Git branches would work for them.

另一种选择是尝试看看您的团队是否喜欢Kiln UI的克隆分支"来维持单独的开发线,而不是使用命名分支方法.

Another option would be to try and see if your team likes the Kiln UI's "clone branch" to maintain separate lines of development versus using the named branch approach.

这篇关于如何使用Git使用Kiln管理分支机构?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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