使用 eclipse 的单人项目的版本控制?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/3097598/
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 14:50:37  来源:igfitidea点击:

version control for one-man project using eclipse?

javaeclipseversion-controlrproject-management

提问by FloE

I'm currently working on several projects on my own (at least the developing part is done only by me :). Using Eclipse with different Java, R, SQL and other source files I'm wondering what version control system would be best for me.

我目前正在自己​​做几个项目(至少开发部分只由我完成:)。将 Eclipse 与不同的 Java、R、SQL 和其他源文件一起使用,我想知道哪种版本控制系统最适合我。

At the time the history of Eclipse IDE seems to be enough, but I'm not sure if this will be true in a month/year...

当时 Eclipse IDE 的历史似乎已经足够了,但我不确定这是否会在一个月/一年内成立......

What solution would you recommend and why?

你会推荐什么解决方案,为什么?

To be more precise: I'm quite sure to use SVN or git if I decide to use a full version control system. But I'm just not sure if it is necessary...

更准确地说:如果我决定使用完整的版本控制系统,我肯定会使用 SVN 或 git。但我不确定是否有必要......

small update: has the release of Eclipse Helios added new opinions?

采纳答案by VonC

a/ It is necessary to have a VCS

a/有必要有一个VCS

b/ CVCS and DVCS are quite different

b/ CVCS 和 DVCS 有很大的不同

c/ Eclipse is currently moving all its project to Git(and is improving on EGit), so Git will be the VCS target on Eclipse.

c/ Eclipse 目前正在将其所有项目转移到 Git(并且正在改进 EGit),因此 Git 将成为 Eclipse 上的 VCS 目标。

回答by Hank Gay

I'd recommend pretty much any of the distributed version control systems. I've used gitand hgin anger, and poked at fossil(I include it because it offers some features that gitand hglack). I'll break down the major pros and cons in my eyes (NOTE: if they all have the same advantage I'm not going to mention it, e.g., they're all fast and lightweight):

我会推荐几乎所有的分布式版本控制系统。我已经使用githg愤怒,并戳了戳fossil(我包括它是因为它提供了一些功能githg缺乏的功能)。我将分解我眼中的主要优点和缺点(注意:如果它们都具有相同的优势,我就不打算提及了,例如,它们都又快又轻):

  • git
    • Pros
      • Very flexible
      • GitHub
    • Cons
      • Steep learning curve
      • More flexible
      • Eclipse integration was lame the last time I looked
  • hg
    • Pros
      • (IMO) more consistent commands
      • Less flexible
      • BitBucket
    • Cons
      • Less flexible
      • Doesn't have quite as much momentum as git
    • Caveats
      • I haven't checked on Eclipse support lately; it used to be better than git's, but seemed rather stagnant
  • fossil(disclaimer: I haven't used this one in anger)
    • Pros
      • Written by the man behind SQLite, so you can be fairly sure it's SOLIDcode
      • Provides more than just version control, e.g., a distributed bug tracker
      • Easy to set up for others to access
    • Cons
      • Not nearly as much momentum as gitor hg
      • I'm pretty sure Eclipse integration for fossilis non-existent (it was the last time I looked)
      • No free hosting that I know of to parallel GitHub or BitBucket, so you actually have to host your repo yourself
  • git
    • 优点
      • 非常灵活
      • GitHub
    • 缺点
      • 陡峭的学习曲线
      • 更灵活
      • 上次我看 Eclipse 集成是蹩脚的
  • hg
    • 优点
      • (IMO) 更一致的命令
      • 不太灵活
      • 比特桶
    • 缺点
      • 不太灵活
      • 没有那么大的动力 git
    • 注意事项
      • 我最近没有检查 Eclipse 支持;它曾经比git's 好,但似乎停滞不前
  • fossil(免责声明:我没有在愤怒中使用过这个)
    • 优点
      • 由 SQLite 背后的人编写,因此您可以相当确定它是SOLID代码
      • 提供的不仅仅是版本控制,例如分布式错误跟踪器
      • 易于设置供他人访问
    • 缺点
      • 几乎没有动量githg
      • 我很确定 Eclipse 集成fossil不存在(这是我最后一次查看)
      • 据我所知,没有免费托管可用于并行 GitHub 或 BitBucket,因此您实际上必须自己托管您的存储库

There are other DVCSs out there, notably including darcsand bzr, but I've not used them enough to have a worthwhile opinion on them.

还有其他 DVCS,特别是包括darcsbzr,但我没有充分使用它们,无法对它们提出有价值的意见。

回答by Felix Kling

Git, because you can start right away and don't need a central repository server.

Git,因为您可以立即开始并且不需要中央存储库服务器。

Some other advantages (compared to other SCMs):

其他一些优势(与其他 SCM 相比):

  • Less cluttered filesystem: Git only creates a folder at the root of the repository (unlike e.g. SVN).
  • Does not interfere that much with "normal" file handling functions. E.g. in SVN you need to use custom commands to rename or move files. That is not the case with Git.
  • 文件系统更简洁:Git 仅在存储库的根目录下创建一个文件夹(与 SVN 不同)。
  • 不会对“正常”文件处理功能造成太大干扰。例如,在 SVN 中,您需要使用自定义命令来重命名或移动文件。Git 的情况并非如此。

I have the feeling Git is very lightweight, so there no reason to wait until your project is "big enough" or whatever.

我觉得 Git 非常轻量级,所以没有理由等到你的项目“足够大”或其他什么。

回答by bully

As far as I understand, it is just a question of which version control system you prefer most.

据我了解,这只是您最喜欢哪种版本控制系统的问题。

But the most performant system is probably git I think. http://www.eclipse.org/egit/for the eclipse plugin :)

但我认为性能最高的系统可能是 git。http://www.eclipse.org/egit/用于 eclipse 插件:)

I would recommend to use a version control system anyway. Even in small projects you will come very fast to the point that a previous solution maybe would have been better. Without a version control system you will do hard reverting changes or revert to previous versions (well, that is one of the great advantages of these systems, right? ;) ).

无论如何,我建议使用版本控制系统。即使在小项目中,您也会很快发现以前的解决方案可能会更好。如果没有版本控制系统,您将很难恢复更改或恢复到以前的版本(嗯,这是这些系统的一大优势,对吧?;))。

回答by kerkeslager

Your comment makes it seem like your real question is whether or not you really need to use version control, given that it's a one-person project.

您的评论看起来像是您真正的问题是您是否真的需要使用版本控制,因为它是一个单人项目。

It takes very little time to set up and use git or mercurial. Just do it. If you don't need it, you've lost a few minutes. If you doneed it, it could potentially save you weeks.

设置和使用 git 或 mercurial 只需要很少的时间。去做就对了。如果你不需要它,你已经失去了几分钟。如果您确实需要它,它可能会为您节省数周时间。

回答by ashurexm

Git and Mercurial (hg) do have a lot of momentum as distributed source code repositories but in my opinion, for a one man band, you will find the most support with Subversion. If you are in Windows there's TortoiseSVN shell integration which is fantastic (it even integrates with Trac) and free Subversion hosting is all over the place and have some personal experience with ProjectLocker.com (they do Git and SVN). Also, Subversion is pretty straightforward to get integrated directly into the Eclipse IDE.

Git 和 Mercurial (hg) 作为分布式源代码存储库确实有很多动力,但在我看来,对于单人乐队,您会发现Subversion 的支持最多。如果您使用的是 Windows,那么 TortoiseSVN shell 集成非常棒(它甚至与 Trac 集成)和免费的 Subversion 托管无处不在,并且对 ProjectLocker.com 有一些个人经验(他们做 Git 和 SVN)。此外,Subversion 可以非常简单地直接集成到 Eclipse IDE 中。

回答by Thorbj?rn Ravn Andersen

There are many benefits from using a SCM instead of just Eclipse histtheitroady even for just a single person:

即使对于一个人来说,使用 SCM 而不仅仅是 Eclipse 历史也有很多好处:

  • comments on commits: you can say WHY you did something. This will help you when you need to figure out why some code does as it does, based on its history.

  • backups: Oh, you messed up your Eclipse workspace completely? Just create a new one, and pull in a fresh copy of the code.

  • continuous integration: check that code builds after every save, runs tests (this is important), and creates the actual binary to send to the customer.

  • 对提交的评论:你可以说你为什么做某事。当您需要根据其历史记录找出某些代码为什么会这样做时,这将对您有所帮助。

  • 备份:哦,你把你的 Eclipse 工作区完全搞砸了?只需创建一个新的,然后拉入一份新的代码副本。

  • 持续集成:在每次保存后检查代码构建,运行测试(这很重要),并创建实际的二进制文件以发送给客户。

It is your safety net. Take the time to learn it, and use it right. You will end up liking it :)

它是您的安全网。花时间学习它,并正确使用它。你最终会喜欢它:)