Bazaar 是否有相当于 Git 默认分支的工具?

发布于 2024-09-10 23:45:57 字数 366 浏览 2 评论 0原文

使用 git,我可以概念上创建分支,而不必对我的目录结构进行分支。当我在分支之间切换时(假设所有内容都已提交),它将更改我正在处理的文件的内容以反映“当前”分支的状态。

真的喜欢能够做到这一点 - 它非常适合我的工作流程,尤其是当我使用 Visual Studio 时。

但我是芭莎的粉丝。我喜欢它主要是用 Python 编写的,我喜欢 GUI 的漂亮和简单(对我来说),而且我喜欢它的跨平台性。

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

Using git, I can create branches conceptually, without having to branch my directory structure. When I switch between branches (assuming that everything has been committed), it will change the contents of the files that I'm working on to reflect whatever the status of the "current" branch is.

I really like being able to do this - it fits very well in my workflow, especially when I'm using say, Visual Studio.

But I am a Bazaar fanboy. I like that it's written mainly in Python, I like how pretty and simple (to me) the GUI is, and I love that it's very cross-platform.

So my desire is that it's possible, and my question is: can Bazaar do/emulate git's behavior? If so, how?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

べ映画 2024-09-17 23:45:57

我在 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"

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

这是您正在寻找的东西吗?

I use (heavyweight) checkouts in Bazaar, so I'm not sure that this will be quite the same for you, but you should be able to do this with the switch command. For example:

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"

You can, of course, also use the absolute path to the branches, but the relative ones save a lot of typing. Unfortunately, the merge command requires a full path.

Is this the sort of thing you're looking for?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文