当地分行与集市? [英] Local branches with Bazaar?

查看:127
本文介绍了当地分行与集市?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近一直在玩Git,以掌握分布式版本控制。现在我正在查看Bazaar,但无法弄清楚如何创建一个本地分支,也就是说,当我想要提交更改时,我不必推送到该分支。有了Git,我会做
$ b $ g $分支branch_name $ / code

p>或



git checkout -b branch_name



然后,我可以在我的本地分支中工作,随时提交更改,而无需将更改推送到远程回购。当我通过分支时,我可以将它合并到我的本地主分支。如果我愿意,我可以将这些更改推送到远程仓库。



Bazaar可以吗? Bazaar看起来更像SVN,分支只是单独的目录,所以也许不是。

解决方案

是的,你绝对可以做到这一点。



假设有一个位于bzr + ssh的远程仓库://foo.com/repo/mainline



你可以创建一个本地分支:

  bzr分支bzr + ssh://foo.com/repo/mainline local_branch 

现在,您可以更改local_branch并提交它们,并且这些更改仅在本地目录。例如:

  cd local_branch 
touch foo
bzr add foo
bzr commit -m添加foo。

只会在本地分支中添加foo。


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.

解决方案

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:

bzr branch bzr+ssh://foo.com/repo/mainline local_branch

Now, you can make changes to the local_branch and commit them, and those changes are only in that local directory. e.g.:

cd local_branch
touch foo
bzr add foo
bzr commit -m "Add foo."

That will add foo only in the local branch.

这篇关于当地分行与集市?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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