bzr pull 与 bzr 合并
我使用 bzr 来完成一个非常简单的任务:获取 GNU Emacs 的开发版本。在最初的 bzr 分支
之后,我希望保持本地版本最新。我阅读了有关 bzr pull
和 bzr merge
的文档,但无法理解它。我尝试了bzr merge
几天,发现bzr merge
经常会导致无法解决的冲突。请注意,我没有进行任何本地更改。 bzr pull
是推荐的方式吗?
编辑1(添加了从Chris Conway窃取的图表):
remote: A --> B --> C --> D
\ \
(branch) (merge)
\ \
local: \--> A (no change) \--> why conflicts?
我了解git和darcs ,但对bzr一无所知。与 git 或 darcs 的类比会有很大帮助。
编辑2:update
是否应该仅与checkout
一起使用?在 branch
中执行 update
似乎没有做任何事情。
I'm using bzr for a very simple task: getting the development version of GNU Emacs. After the initial bzr branch
, I'd like to keep my local version up to date. I read about the documentation on bzr pull
and bzr merge
, but couldn't make sense out of it. I tried bzr merge
for a few days, and found that bzr merge
often resulted in unresolvable conflicts. Note that I didn't make any local changes. Is bzr pull
the recommended way?
EDIT 1 (added a diagram stolen from Chris Conway):
remote: A --> B --> C --> D
\ \
(branch) (merge)
\ \
local: \--> A (no change) \--> why conflicts?
I understand git and darcs, but have no knowledge about bzr. Analogies to git or darcs will help a lot.
EDIT 2: Is update
supposed to work with checkout
only? Doing an update
in a branch
doesn't seem to do anything.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
是的,听起来
bzr pull
是适合您使用的命令。pull
获取远程源分支并将所有更改从其复制到较旧版本的本地目标分支。 (我在这里使用“远程”和“本地”来表示“源”和“目的地”。任何两个分支都可以,甚至两个本地分支。)仅当两个分支没有时,
pull
才有效。 t 发散,即,如果目标的修订版是源的旧修订版。push
正是相反的操作:它将本地分支中的更改复制到较旧版本的远程分支。当您想要将更改复制到与远程分支不同的本地分支时,可以使用合并。
这里,
Z
包括来自D
的所有更改和来自Y
的更改。在这种情况下,不可能进行拉动
。请注意,您必须在合并
后提交
才能保存新的合并修订,而拉取会自动将分支带到已保存的修订点。checkout
允许您以类似于 CVS/SVN 的模式使用 bzr:本地分支将“附加”到远程分支;commit
将自动push
;如果远程分支发生分歧,则提交将失败;更新
只是来自“附加”远程分支的合并
。Yes, it sounds like
bzr pull
is the appropriate command for your use.pull
takes a remote source branch and copies any changes from it to a local destination branch at an older revision. (I use "remote" and "local" here to mean "source" and "destination." Any two branches will do, even two local branches.)A
pull
only works if the two branches haven't diverged, i.e., if the revision of the destination is an old revision of the source.push
is just the opposite operation: it copies changes in a local branch to remote branch at an older revision.A
merge
is used when you want to copy changes to a local branch that has diverged from the remote branch.Here,
Z
includes all of the changes fromD
and the changes fromY
. Apull
is not possible in this case. Note that you mustcommit
after amerge
in order to save the new merged revision, whereas a pull automatically brings the branch to a saved revision point.A
checkout
allows you to use bzr in a mode that is similar to CVS/SVN: the local branch will be "attached" to a remote branch;commit
s will be automaticallypush
ed; if the remote branch has diverged, the commit will fail; anupdate
is just amerge
from the "attached" remote branch.合并用于合并两个不同的分支,而不是副本(本地和远程)。
使用拉力。
Merge is for merging two different branches, not copies (local and remote).
Use pull.
$
bzr 帮助拉
所以你可以使用:
$
bzr pull --overwrite
$
bzr help pull
so you can use:
$
bzr pull --overwrite