代码之家  ›  专栏  ›  技术社区  ›  Wayne Werner

有没有类似于Git默认分支的Bazaar?

  •  4
  • Wayne Werner  · 技术社区  · 14 年前

    使用git,我可以创建分支 conceptually

    真正地

    但我是集市迷。我喜欢它主要是用Python编写的,我喜欢GUI(对我来说)是多么漂亮和简单,我喜欢它非常跨平台。

    所以我的愿望是这是可能的,我的问题是:Bazaar能模仿git的行为吗?如果是,怎么做?

    1 回复  |  直到 10 年前
        1
  •  3
  •   DrAl    14 年前

    我在Bazaar使用(重量级)结账,所以我不确定这对您来说是否完全相同,但您应该可以使用 switch 命令。例如:

    mkdir source-repo
    bzr init-repo --no-trees source-repo
    bzr init source-repo/trunk
    bzr co source-repo/trunk workdir
    cd workdir
    # Hack hack hack
    bzr add
    bzr ci -m "Done some stuff"
    # Now create a branch and change the working directory files to match it
    bzr switch -b my-new-branch
    # We're now working on a checkout of ../source-repo/my-new-branch
    # Hack hack hack
    bzr add
    bzr ci -m "Working on the branch"
    # Now go back to the trunk (no -b as we're not creating the branch)
    bzr switch trunk
    # Working directory files now match the trunk branch
    # Hack hack hack
    bzr add
    bzr ci -m "Changes to trunk"
    # Merge in the changes from my-new-branch
    bzr merge ../source-repo/my-new-branch
    bzr ci -m "Merged my-new-branch"
    

    当然,您也可以使用分支的绝对路径,但是相对路径可以节省大量的输入。不幸的是,merge命令需要完整路径。