当地有 Bazaar 分店吗?
我最近一直在研究 Git,以掌握分布式版本控制。现在我正在查看 Bazaar,但不知道如何创建本地分支,即当我想提交更改时不必推送到的分支。使用 Git,我可以执行
gitbranch_name
或
git checkout -bbranch_name
然后我可以在本地分支中工作,随时提交更改,而无需将更改推送到远程仓库。当我完成分支后,我可以将其合并到本地主分支。如果我愿意,我可以将这些更改推送到远程存储库。
Bazaar 可以做到这一点吗? Bazaar 看起来更像 SVN,分支只是单独的目录,所以也许不是。
I've been playing around with Git recently to get a grasp of distributed version control. Now I'm looking at Bazaar, but can't figure out how to make a local branch, i.e. a branch that I do not have to push to when I want to commit changes. With Git, I would do
git branch branch_name
or
git checkout -b branch_name
I can then work in my local branch, committing changes as I go, without having to push changes to a remote repo. When I'm through with the branch, I can merge it to my local master branch. If I want, I can then push those changes to the remote repo.
Is this possible with Bazaar? Bazaar seems much more like SVN, with branches just being separate directories, so maybe not.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
是的,你绝对可以做到。
假设有一个远程存储库位于 bzr+ssh://foo.com/repo/mainline
您可以通过以下方式创建本地分支:
现在,您可以对 local_branch 进行更改并提交它们,并且这些更改仅在该本地分支中目录。例如:
这只会在本地分支中添加 foo 。
Yes, you definitely can do that.
Let's say there's a remote repository at bzr+ssh://foo.com/repo/mainline
You can create a local branch by doing:
Now, you can make changes to the local_branch and commit them, and those changes are only in that local directory. e.g.:
That will add foo only in the local branch.
如果您以正确的方式设置存储库,则可以以与 git 类似的方式工作。
这将创建一个像这样的结构:
如果你想创建分支,你可以执行以下操作:
现在你将处于
some-feature
分支中,该分支将与主线。If you set up your repository the correct way, you can work in a similar fashion to git.
This will create a structure like so:
And if you want to make branches, you can do the following:
and now you'll be in the
some-feature
branch, which will be at the same point as mainline.老问题,但似乎 共置分支 是解决问题的方法如今这个。 Bzr 包含一个 插件,具有各种便利功能,包括
colo-init
用于创建支持并置分支的存储库,colo-branch
用于实际使用/创建分支(我还没有广泛使用这些功能,所以我可能会将此作为有点乱..)Old question, but it appears that colocated branches are the way to go for this nowadays. Bzr includes a plugin with various convenience functions, including
colo-init
for creating colocated-branch-enabled repositories andcolo-branch
for actually using/creating branches (I have not made extensive use of these features yet, so I may have this a bit jumbled..)bzr 与 git 的不同之处在于你无法切换工作目录所代表的分支。不过,您可以从工作目录进行分支,而不必从远程存储库进行分支。所以代替
你会做
bzr differs from git in that you can't switch the branch represented by the working directory. You can branch from your working directory, though, instead of having to branch from the remote repository. So instead of
you would do