简体   繁体   English

如何让我的同事不要鄙视SVN?

[英]How do I make my colleagues not despise SVN?

Many of my colleagues use SVN in groups of 1-5 people partly working on the specific project. 我的许多同事在1-5人的团队中使用SVN,部分工作在特定项目上。 Half of them are inexperienced students. 其中一半是没有经验的学生。 In fact non of us are real software developers with year-long experience. 事实上,我们不是真正的软件开发人员,具有一年的经验。 Most of them use Eclipse and subclipse to read and write their contributions to the SVN repositories. 他们中的大多数使用Eclipse和subclipse来读取和写入他们对SVN存储库的贡献。

Some of them have problems with the difference of: 他们中的一些人有以下不同的问题:

  • checking out (confused with update and merge) 签出(与更新和合并混淆)
  • commiting (confused with update) 提交(与更新混淆)
  • updating (confused with commit and check out) 更新(与提交和签出混淆)
  • merging (is the hardest. Whats a merge? Do i have to merge my code "into the SVN"?) 合并(是最难的。什么是合并?我必须将我的代码合并到SVN中吗?)

They fear that the SVN might kill their work (they don't call it working branch) if they press the wrong button. 如果他们按错了按钮,他们担心SVN可能会杀死他们的工作(他们不称之为工作分支)。

They are committing their eclipse .project files to the repository, after adding some arbitrary library dependencies to their java projects. 在将一些任意库依赖项添加到其java项目之后,他们将eclipse .project文件提交到存储库。 The other colleagues get compilation errors from these comitts and find it hard to resolve these. 其他同事从这些comitts得到编译错误,并发现很难解决这些问题。

In general they say: I'd like to work without SVN, I don't like it. 一般来说,他们说: 我想在没有SVN的情况下工作,我不喜欢它。 It's too complex. 这太复杂了。

Is there a e-learning project like "SVN for kids"? 有没有像“SVN for kids”这样的电子学习项目? How can I make them like version control? 我怎样才能让它们像版本控制一样?

In my experience, one of the main reasons why so many people are "afraid" of, or don't like, version control is because they don't understand the underlying concepts and how the system works . 根据我的经验,为什么这么多人“害怕”或不喜欢版本控制的一个主要原因是因为他们不了解基本概念以及系统如何工作 This is, unfortunately, also true for many experienced developers. 不幸的是,对于许多有经验的开发人员来说,这也是如此。 I know people who have used CVS and Subversion for years, but they never create branches or tags, because they don't understand how they work, and therefore see them as "complicated" or "unnecessary". 我知道多年来一直使用CVS和Subversion的人,但他们从不创建分支或标签,因为他们不了解它们是如何工作的,因此将它们视为“复杂”或“不必要”。

I think it's essential that your co-workers gain a basic understanding of the purpose of version control, the reasons for using it, and the workflow involved in doing so . 我认为您的同事必须基本了解版本控制的目的,使用它的原因以及执行此操作所涉及的工作流程 Personally, I think the first two chapters of the Subversion book provide the best explanation of the involved concepts and the theory behind version control systems in general, so I recommend your co-workers to read those. 就个人而言,我认为Subversion书的前两章提供了对所涉及的概念和版本控制系统背后的理论的最佳解释,因此我建议你的同事阅读这些。

I do not recommend using an IDE integration to learn using version control . 建议使用IDE集成来学习使用版本控制 Integrations and plug-ins often hide the "details" of the system from the user, which can be very confusing, especially if you don't know what things looke like "under the hood". 集成和插件通常会隐藏用户的系统“细节”,这可能非常令人困惑,特别是如果你不知道“引擎盖”之类的东西。

I prefer tools like TortoiseSVN , where you perform most operations directly, and manually, without any "magic" behind the scenes. 我更喜欢像TortoiseSVN这样的工具,你可以直接执行大多数操作,也可以手工操作,在幕后没有任何“魔法”。 For example, a very common misconception is not understanding the difference between your working copy and the repository on the server. 例如,一个非常常见的误解是不了解工作副本与服务器上的存储库之间的差异。 I have often seen that switching to a tool where you operate directly on the file system will help with this situation, because the user is forced to activeley think about what he is doing, and why. 我经常看到,切换到直接在文件系统上运行的工具将有助于解决这种情况,因为用户被迫主动思考他在做什么,以及为什么。

As with pretty much everything else in life, using version control is also done best by personal experience—trying and failing, and trying again. 与生活中的其他一切一样,使用版本控制也是最好的个人经验 - 尝试和失败,并再次尝试。 This is why I recommend creating sandbox home folders for everyone . 这就是我建议为每个人创建沙箱主文件夹的原因 Allow them to experiment with the various functions in the system without the fear of destroying anything in the project or losing data. 允许他们在系统中试验各种功能,而不必担心破坏项目中的任何内容或丢失数据。

First, you need to take a "software-independent" approach at looking at this problem. 首先,您需要采用“独立于软件”的方法来研究这个问题。 Don't force them to read the Red Bean book, or try telling them about all the nifty SVN commands. 不要强迫他们阅读Red Bean书籍,或者尝试告诉他们所有漂亮的SVN命令。 Instead, you should start by trying to teach the proper workflow with version control. 相反,您应该首先尝试使用版本控制来教授正确的工作流程。 In a nutshell, that means: 简而言之,这意味着:

  1. Update your view 更新您的视图
  2. Make some changes 做一些改变
  3. Test your code 测试你的代码
  4. Update again 再次更新
  5. Solve merge conflicts, if necessary 如有必要,解决合并冲突
  6. Commit 承诺

Note here that I'm excluding the initial check-out process, as you should be there to help them check out their initial view. 请注意,我将排除初始签出流程,因为您应该在那里帮助他们查看他们的初始视图。 The above steps is only what SCM-enabled developers should do every day (btw, you should also really emphasize that, or else people that have a fear of merge conflicts will only get worse over time). 上述步骤只是SCM支持的开发人员每天应该做的事情(顺便说一句,你也应该真正强调这一点,否则那些担心合并冲突的人只会随着时间的推移而变得更糟)。

The key to successful SCM adoption is twofold; SCM成功采用的关键是双重的; first you need to get people used to working with the software doing normal, non-painful things (ie, update/commit). 首先,您需要让人们习惯使用软件来处理正常的,非痛苦的事情(即更新/提交)。 If you don't do this, then the developers will tend to avoid using SCM until you bother them about it and ask why they haven't committed any code in two weeks. 如果你不这样做,那么开发人员将倾向于避免使用SCM,直到你为此烦恼并询问为什么他们在两周内没有提交任何代码。 Second, you need to teach people how to overcome the common painful scenarios which might cause them to loose their work. 其次,你需要教会人们如何克服可能导致他们失去工作的常见痛苦场景。

It is indeed possible for an SCM system to destroy work, and it usually happens before anything gets committed to the repository with merge conflicts. SCM系统确实可能会破坏工作,并且通常任何事件通过合并冲突提交到存储库之前发生。 You should simulate merge conflicts, walk them through resolving them, and then have them do the same on their own. 你应该模拟合并冲突,让他们解决它们,然后让它们自己做同样的事情。 You should explain: 你应该解释一下:

  • What the meaning of the .r1, .r2, .mine, and the original file will contain after a conflict 冲突后,.r1,.r2,.mine和原始文件的含义是什么?
  • Show how to graphically resolve the conflicts 演示如何以图形方式解决冲突
  • Now re-compile and test the software again just to make sure 现在重新编译并再次测试软件以确保
  • Make a backup of the .mine file, again, just to make sure 再次备份.mine文件,以确保
  • Then commit 然后提交

There are many more complex things within SCM, and this should only be explained much later after the basics are well understood. 境内有许多SCM更复杂的事情,而这只能更晚后基本是很好理解的解释。 Don't even bother mentioning merging or tagging or anything like that until they have a few weeks of everyday experience under their belts. 甚至不用提及合并或标记或类似的东西,直到他们有几周的日常经验。 Otherwise, the complexity and additional risk will make this new tool seem even more "useless" to them. 否则,复杂性和额外的风险将使这个新工具对他们来说更加“无用”。

Again, the key here is to emphasize the daily SCM workflow, in a software-neutral manner, and slowly explain the quirks of the particular SCM system as they come up. 同样,这里的关键是以软件中立的方式强调每日SCM工作流程,并慢慢解释特定SCM系统出现时的怪癖。 Merging is the only complicated thing that needs to be explained at first, as it is likely the only painful thing encountered on a daily basis. 合并是唯一需要首先解释的复杂因素,因为它可能是每天遇到的唯一痛苦的事情。 Everything else should be explained as it comes up. 其他所有内容都应该在出现时加以解释。

A simple "cheatsheet" on the needed procedures, given step-by-step, is the best way. 对于所需程序的简单“备忘单”,一步一步给出,是最好的方法。 SVN does have some pitfalls that aren't obvious. SVN确实有一些不明显的陷阱。 I've been involved with new people using it, and on occasions they do blow away whole chunks of code from the current revision, etc. Of course, you can always go back and get from previous versions, but SVN is scary and hazardous to new people. 我已经参与了使用它的新人,有时他们会从当前的版本中删除整个代码块等等。当然,你总是可以回过头来获取以前的版本,但是SVN 可怕的和危险的新人。 Keep that in mind and write very simple but explicit instructions for the needed operations! 牢记这一点,并为所需的操作编写非常简单但明确的指令!

"How can I make them like version control?" “我怎样才能让它们像版本控制一样?”

Delete their working copies and they'll quickly grasp how useful version control software can be! 删除他们的工作副本,他们将很快掌握有用的版本控制软件!

Seriously, using VCS is something that goes hand-in-hand with being a mature developer. 说真的,使用VCS与成熟的开发人员并驾齐驱。 If you don't know why you'd want Subversion, I wouldn't trust them as developers. 如果你不知道为什么你想要Subversion,我不会相信他们是开发者。 They may have skill programming, but programming is only a part of the job of being a developer. 他们可能有技能编程,但编程只是开发人员工作的一部分。

I do believe that until you've lost code, you'll truly never appreciate VCS. 我确实相信,在你丢失代码之前,你真的永远不会欣赏VCS。

  • unlimited undo - no need to worry about lost changes 无限撤消 - 无需担心丢失的更改
  • backup, not your responsibility any more 备份,不再是你的责任了
  • 'time machine' functionality - what did the code look like on last Friday evening? '时间机器'功能 - 上周五晚上的代码是什么样的?
  • collaboration 合作
  • central, "official" version of the source code makes easy to build releases 中央,“官方”版本的源代码使得易于构建版本
  • comparison: someone dared to touch your code, what did he change exactly? 比较:有人敢碰你的代码,他究竟改变了什么?
  • tagging: tag stable versions which are ready for demonstrations, you can keep developing in the code base after 标记:标记稳定版本,可以进行演示,您可以继续在代码库中进行开发

The 'merging' only needed when two developers modify the same line in the same source files. 只有当两个开发人员修改相同源文件中的同一行时才需要'合并'。 It doesn't occur very often in small teams and it takes a couple of minutes to fix. 它在小团队中并不经常发生,需要几分钟才能解决。 All other changes merged automatically by the version control system. 版本控制系统自动合并所有其他更改。

If they are mostly students, one selling point is that out here in the "real world" many people take versioning very seriously. 如果他们大多是学生,那么在“现实世界”中有一个卖点就是很多人非常重视版本控制。

If they are afraid of deleting something, demonstrate deleting some crucial file and demonstrate the ability to restore deleted files . 如果他们害怕删除某些内容,请演示删除一些重要文件并演示恢复已删除文件的能力。

Or they might like a different kind of version control all-together suchas git or mercurial. 或者他们可能喜欢不同类型的版本控制,例如git或mercurial。

Give them a brief talk on svn. 给他们一个关于svn的简短讲话。 tell them what the benifits are and how to use it. 告诉他们好处是什么以及如何使用它。

I managed to pick up SVN in my first job out of University with not trouble what so ever, though I was using it at a file system level using tortoise SVN. 我设法在大学的第一份工作中拿起SVN并没有遇到任何麻烦,尽管我在使用tortoise SVN的文件系统级别使用它。 I'm not that smart so if I can pick it up anyone can. 我不是那么聪明,所以如果我可以拿起它,任何人都可以。

Run through some scenarios with them on why version control is good. 与它们一起运行一些场景,了解为什么版本控制是好的。 Even better, put them through some toy projects where time pressure makes them commit frequently. 更好的是,让他们通过一些玩具项目,时间压力使他们经常提交。 In some allow them only to share code through svn, and in others to share it only through shared directories. 在某些情况下,只允许它们通过svn共享代码,而在其他情况下只能通过共享目录共享代码。

After that they'll know what it's about. 之后他们会知道它是什么。

You can't really make anyone like it. 你真的不能让任何人喜欢它。 But if you just start using it yourself and set a good example, the benefits will become apparent. 但是如果你自己开始使用它并树立了一个很好的例子,那么好处就会变得明显。 You need to update the server constantly and make sure the server is backed up. 您需要不断更新服务器并确保服务器已备份。 That way when there is a crazy bug in the system you will have the logs to show the change that caused the bug. 这样,当系统中存在一个疯狂的错误时,您将拥有日志以显示导致该错误的更改。 You know what you need to do. 你知道你需要做什么。 Don't let the ignorance of others stop you. 不要让别人的无知阻止你。

Version control greatest problem is the conflict resolution. 版本控制最大的问题是冲突解决。 If you really want to play safe, try this workflow: 如果您真的想玩安全,请尝试以下工作流程:

  1. Every developer create a branch from the main trunk before starting to code; 在开始编码之前,每个开发人员都从主干创建一个分支;
  2. A developer implements a feature in his own branch and commit (no need to update, since he is the sole developer in his branch); 开发人员在他自己的分支中实现一个功能并提交(不需要更新,因为他是他的分支中的唯一开发人员);
  3. A couple of more experienced developers review the code, test and merge the branch revisions to the main trunk; 一些更有经验的开发人员审查代码,测试并将分支修订合并到主干;
  4. rinse and repeat 冲洗并重复

Subversion 1.5 new features are really great for this kind of workflow. Subversion 1.5新功能非常适合这种工作流程。

Try this . 试试这个 I found it on an 'SVN for dummies' search and it was described as a 'SVN for Dummies, a guide your grandma can understand' :D 我发现它是'SVN for dummies'搜索,它被描述为'傻瓜SVN,奶奶可以理解的指南':D

这是一个体面的SVN“cheatsheet”,描述了基本用法: http//abbeyworkshop.com/howto/misc/svn01/

K make your friends read this. K让你的朋友读这个。 Next learning the cli first on a few pet projects clarifies this greatly. 接下来,在几个宠物项目中首先学习cli可以大大澄清这一点。 My first go at subclipse about made me hate eclipse. 我第一次看到subclipse让我讨厌eclipse。 Partially because I had never used subversion before. 部分是因为我之前从未使用过颠覆。

  • checking out = get a local copy of the code that is in the repository. check out =获取存储库中代码的本地副本。
  • Update = makes sure your local copy is up to date with the master copy. Update =确保您的本地副本与主副本保持同步。 aka the server. 又名服务器。
  • commit = add your changes to the master copy commit =将更改添加到主副本
  • merge = you plus someone else has committed since you checked out. merge =你加上其他人已经提交了你已经提交。 merging allows for you to keep BOTH sets of changes via a little supervised editing. 合并允许您通过一点监督编辑保留两组更改。

Merging is a neat feature but a bit complex at first go. 合并是一个很好的功能,但一开始有点复杂。

I would suggest them reading at least the basic parts of 我建议他们至少阅读基本部分 http://svnbook.red-bean.com/en/1.5/index.html , it is well written with some humor thrown in. It covers using the command line tools, but the concepts are the same no matter what interface you are using (ie TortoiseSVN or Subclipse) http://svnbook.red-bean.com/en/1.5/index.html ,它写得很精彩。它涵盖了使用命令行工具,但无论你是什么界面,概念都是一样的使用(即TortoiseSVN或Subclipse)

SVN keeps track of all changes since the project start, so there's practically no way to throw away your work just by hitting the "wrong" button. SVN跟踪项目启动后的所有变化,因此几乎没有办法通过点击“错误”按钮丢弃你的工作。 I really think that all significant work should be under version control , even if there's no team (I code alone and I use it). 我真的认为所有重要的工作都应该在版本控制之下 ,即使没有团队(我只使用代码并使用它)。

I never really saw the point until I read this little book , try to make them read at least the first 20 pages. 在我读完这本小书之前 ,我从未真正看到过这一点 ,试着让它们至少阅读前20页。 There's a good analogy there between subversion and the "undo" button of any editor, that may convince them of using it (it worked with me :) ) 在subversion和任何编辑器的“撤消”按钮之间有一个很好的类比,这可能说服他们使用它(它与我合作:))

Send them to: 发送给:

Impress upon them that they will be denigrated as complete and utter fools by anyone who uses a half decent source control system (ie not VSS). 给他们留下深刻印象的是,任何使用半个合适的源控制系统(即不是VSS)的人都会将他们诋毁为完全和彻底的傻瓜。

You need to really sell them on the concepts of version control first so that they understand how svn works. 你需要首先在版本控制的概念上出售它们,以便他们了解svn的工作原理。

A few things to try are 要尝试的一些事情是

  • Create a sandbox repository for training and experimentation 创建沙箱存储库以进行培训和实验
  • Try to organise some training sessions/ workshops. 尝试组织一些培训课程/研讨会。 If you're not confident in running that your self, try chatting to your local Linux User Group to see if they know someone who can help. 如果您对自己的运行没有信心,请尝试与当地的Linux用户组聊天,看看他们是否认识可以提供帮助的人。
  • Document your development process including the common subversion usage scenarios. 记录您的开发过程,包括常见的subversion使用场景。

Its also worth pointing out to the students that experience with source control will be a plus for their CVs. 值得向学生们指出,源代码控制经验对他们的简历来说也是一个优势。

On your specific issue of committing .project files you can either set the svn:ignore property on a property or you can set the global-ignores value in each users subversion config file. 关于提交.project文件的具体问题,您可以在属性上设置svn:ignore属性,也可以在每个用户subversion配置文件中设置global-ignores值。

You might want to create aliases for the most dangerous commands (I'm thinking mostly of revert) that would require explicit confirmation before calling the svn command. 您可能希望为调用svn命令之前需要显式确认的最危险命令(我主要考虑恢复)创建别名。

Also, if they're using Eclipse, they can set up their editor so that it will keep N work copies of the current code. 此外,如果他们使用Eclipse,他们可以设置他们的编辑器,以便它保留当前代码的N个工作副本。 I've saved myself from a couple of stupid version control mistakes with that feature. 我已经从这个功能的几个愚蠢的版本控制错误中拯救了自己。

They can always try "the poor man's CVS": have them do a ZIP of their code a moment before they check in/out anything, and store them numbered somewhere in their hard drives. 他们总是可以尝试“穷人的CVS”:让他们在签入/退出任何东西之前做一段他们的代码,并将它们存储在硬盘中的某个地方。

In the end, they'll have a bunch of files like: 最后,他们会有一堆文件,如:

  • MyProject01.zip MyProject01.zip
  • MyProject02.zip MyProject02.zip
  • (etc) (等等)

This shall give them the piece of mind that their "work" will not get "destroyed" in case they do something stupid, and will be cumbersome enough to force them to learn how to use SVN properly (come on, it's not that difficult!). 这将使他们明白他们的“工作”不会被“摧毁”以防他们做一些愚蠢的事情,并且会非常麻烦,迫使他们学习如何正确使用SVN(来吧,这并不难! )。

I've personally found this poor man's approach to be far superior to Visual SourceSafe: at a former employer's I was forced to use that monstrosity... after the second time the repository completely broke down, they thanked me for this :D 我个人发现这个穷人的方法远远优于Visual SourceSafe:在一个前雇主我被迫使用那个怪物......在第二次存储库完全崩溃后,他们感谢我:D

If you are developing in windows machines, try to use TortoiseSVN as your subversion client. 如果您正在使用Windows机器进行开发,请尝试使用TortoiseSVN作为您的subversion客户端。 The interface is really great. 界面真的很棒。 I will help them to loose the version control fear. 我会帮助他们摆脱版本控制恐惧。

Its all about confidence in using something new, and understanding what it is that they're using. 这完全取决于使用新东西的信心,并了解它们正在使用的东西。 Once you've used it, are happy it works, the 'disagreement' disappears. 一旦你使用它,它很高兴它有效,'分歧'消失了。

Try a training overview first - here's a project that provides some powerpoint slides to help. 首先尝试培训概述 - 这是一个提供一些powerpoint幻灯片的项目

Give them the svn book and links to TortoiseSVN to read up on it once they have the overview. 给他们一本svn书并链接到TortoiseSVN,一旦他们有了概述,就可以阅读它。

Then try a hand-on workshop with a sandbox repo. 然后尝试一个带沙盒回购的实践工作坊。

Then be available to assist for a week or so while they use it for real. 然后可以在他们真正使用它的同时提供一周左右的帮助。

this approach works for everything, not just SVN. 这种方法适用于所有方面,而不仅仅是SVN。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM