使用 Git 还是 Bazaar 更容易管理代码?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/1010588/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-19 03:43:16  来源:igfitidea点击:

Is it easier to manage code with Git or Bazaar?

gitversion-controlbazaar

提问by Roman Kagan

I'm researching the Gitand Bazaarcapabilities and wonder which one has more feature-rich code management?

我正在研究 GitBazaar功能,想知道哪个功能更丰富的代码管理?

回答by VonC

I suppose you also read Bazaar vs. Gitarticle, but in the end, it all comes down to what youare looking for in term of "feature-rich code management".

我想您也阅读了Bazaar 与 Git 的文章,但最终,这一切都归结为在“功能丰富的代码管理”方面的需求。

  • If, by code management, you are referring to file(and directories and renaming), go with Bazaar.

  • If, by code management, you are looking at contentmanagement, Git is designed to manage just that (the staging area, for instance, allows you to record what current contentyou want to commit, even though you have already begun to make some large modification you end up not wanting to commit in the current branch)

  • 如果通过代码管理,您指的是文件(和目录和重命名),请使用 Bazaar。

  • 如果通过代码管理,您正在查看内容管理,Git 旨在管理它(例如,暂存区允许您记录当前要提交的内容,即使您已经开始制作一些大型修改你最终不想在当前分支中提交)

To be sure, re-read Linus's original visionfor Git (back in April 2005). If you do agree with it, chances are Git will deliver what you want. In short:

可以肯定的是,请重新阅读Linus 最初的 Git愿景(早在 2005 年 4 月)。如果你同意它,那么 Git 很可能会提供你想要的东西。简而言之:

  • very simple model (blob-tree-commit-tag)
  • no metadata added (for tracking renaming for instance)
  • "strong" principles like:
    • "files" do not matter. The only thing that matters is how "content" moved in the tree
    • You have an SCM that tracks what changed at the only level that really matters, namely the whole project. None of the information actually makes any sense at all at a smaller granularity, since by definition, a "project" depends on the other files, or it wouldn't be a project
  • 非常简单的模型(blob-tree-commit-tag)
  • 未添加元数据(例如用于跟踪重命名)
  • “强”原则,如:
    • “文件”无关紧要。唯一重要的是“内容”如何在树中移动
    • 您有一个 SCM 来跟踪唯一真正重要的级别(即整个项目)发生的变化。在更小的粒度上,这些信息实际上根本没有任何意义,因为根据定义,“项目”取决于其他文件,否则它就不是项目

That "all project" notion is actually a strength and a limitfor Git in term of project management: you should not seek to put everythinginto oneGit repository.

“所有项目”的概念实际上是Git 在项目管理方面的优势和限制:您不应该试图将所有内容都放在一个Git 存储库中。

回答by Instance Hunter

It's going to come down to personal preference, plain and simple.

这将归结为个人喜好,简单明了。

I use Bazaar and find it extremely easy. The staging area concept in Git gives some nice flexibility but it also adds complexity. You can quite easily manage code in Bazaar with something like 4 commands (add, commit, merge (maybe push/pull) and log or qlog), and you only need merge if you want multiple branches.

我使用 Bazaar 并发现它非常容易。Git 中的暂存区概念提供了一些很好的灵活性,但也增加了复杂性。您可以使用 4 个命令(添加、提交、合并(可能是推/拉)和日志或 qlog)轻松管理 Bazaar 中的代码,如果您需要多个分支,则只需要合并。

Usually Bazaar seems to do the right thing. I've never really had a problem with it doing something stupid or letting me do something stupid.

通常 Bazaar 似乎做正确的事。我从来没有遇到过做一些愚蠢的事情或让我做一些愚蠢的事情的问题。

回答by Matthieu Moy

Bazaar's development has stopped. The last release is 2.6, dated 2013-08-04. There have been less than 20 commits since thenas of April 2015.

Bazaar 的发展已经停止。最后一个版本是 2.6,日期为 2013-08-04。已经有自那以后不到20所提交的2015年4月的。

If you're starting with version control, you should consider one that is active (most likely this will be Git or Mercurial).

如果您从版本控制开始,您应该考虑一个处于活动状态的(很可能是 Git 或 Mercurial)。

Edit 1: a 2.7 release was made since my post, but it doesn't change the fact that the project is essentially dead with ~10 commits/year.

编辑 1:自我的帖子发布后发布了 2.7 版本,但它并没有改变该项目基本上以每年约 10 次提交而死亡的事实。

Edit 2: there's now a fork of bazaar called Breezywith more activity than Bazaar. I doubt this will become a really active project, but at least this means the tool is maintained (it should survive the end of Python 2 for example, one of the goals of Breezy being to port to Python 3).

编辑 2:现在有一个名为Breezy的集市分支,比 Bazaar 更活跃。我怀疑这会成为一个真正活跃的项目,但至少这意味着该工具得到维护(例如,它应该在 Python 2 结束后继续存在,Breezy 的目标之一是移植到 Python 3)。

回答by David Cournapeau

I think it depends on your personal taste - there are arguments for both of them. I have used bzr extensively for personal projects for a couple of years, since the 0.8 days, but I have switched to git last year, and never looked back, at least for source code management.

我认为这取决于你的个人品味 - 他们都有争论。从 0.8 天开始,我已经将 bzr 广泛用于个人项目已有几年了,但我去年改用了 git,并且再也没有回头,至少在源代码管理方面是这样。

I am too lazy to rewrite my own impression, but to sum it up:

懒得改写自己的印象了,总结一下:

  • bzr works more consistently across platforms
  • bzr is more discoverable (if you are given the tool wo any documentation, any semi-competent user will be able to use bzr, that's not so true with git)
  • bzr is easier to extend in an API way, git is easier to extend in a unix way (pipes)
  • git is immensely more powerful IMHO; in particular, I am convinced that their approach for rename handling, and content tracking is the right one for many cases
  • the bzr revno system is not good IMHO. It looks simpler, but it is deeply confusing once you start having many branches and change the mainline.
  • bzr 跨平台更一致地工作
  • bzr 更容易被发现(如果你得到了工具 wo 的任何文档,任何半能干的用户都可以使用 bzr,这对 git 来说不是这样)
  • bzr 更容易以 API 方式扩展,git 更容易以 unix 方式扩展(管道)
  • 恕我直言,git 非常强大;特别是,我相信他们的重命名处理和内容跟踪方法在许多情况下都是正确的
  • bzr revno 系统不好恕我直言。它看起来更简单,但一旦你开始有很多分支并改变主线,它就会非常混乱。

回答by Erik Aronesty

The best reason to use git vs bzr/hg is because github rocks. Launchpad is OK, but github gets search, social and style right.

使用 git 与 bzr/hg 的最佳理由是因为 github 非常棒。Launchpad 还可以,但 github 的搜索、社交和风格是正确的。

Technically launchpad is probably better in many ways. Merges, integrated build systems, and other features make launchpad appealing to many. The builtin editor on github, the gists... there's a flow there that launchpad doesn't have. Visually, socially, there's no competition.

从技术上讲,启动板可能在很多方面都更好。合并、集成构建系统和其他功能使启动板对许多人具有吸引力。github 上的内置编辑器、要点……那里有一个启动板没有的流程。在视觉上,在社交上,没有竞争。

回答by Jo?o Marcus

The one thing that Git does much, much better is handling lots of branches. It does it much faster than bzr, and doesn't require multiple copies of the source code. All branches are inside the same directory. I find myself using git branches much more often than I used to do with bzr, specially because my repo is not small and also involves binary files (total 180MB).

Git 做得更好的一件事是处理大量分支。它比 bzr 快得多,并且不需要源代码的多个副本。所有分支都在同一个目录中。我发现自己使用 git 分支的频率比使用 bzr 的频率要高得多,特别是因为我的 repo 并不小,而且还涉及二进制文件(总共 180MB)。

EDIT: Actually, I'm wrong. --no-trees + lightweight checkout does work like Git. Thanks, FryGuy. Oh, and I found this blog entrywhich has useful information.

编辑:实际上,我错了。--no-trees + 轻量级结帐确实像 Git 一样工作。谢谢,弗莱盖伊。哦,我发现这个博客条目包含有用的信息。

回答by Vivek Sharma

Bazaar is very well integrated with ubuntu, I have been using ubuntu for many years now, tired to switch to other more geeky distro, but no point. I choose bazaar over git/mercurial coz bazaar is notifications are very well integrated in Ubuntu. In addition you get free hosting from Launchpad which is a huge plus.

Bazaar 与 ubuntu 集成得很好,我已经使用 ubuntu 很多年了,厌倦了切换到其他更令人讨厌的发行版,但没有意义。我选择 bazaar 而不是 git/mercurial 因为 bazaar 通知在 Ubuntu 中集成得很好。此外,您可以从 Launchpad 获得免费托管,这是一个巨大的优势。