Why you should be using a distributed version control system

26
Why you should be using a Why you should be using a distributed version control system distributed version control system (DVCS) for your project (DVCS) for your project Lenz Grimmer < Lenz Grimmer <[email protected] > > http://lenzg.net/ | Twitter: | Twitter: @lenzgr 2009-12-03 2009-12-03 SAPO Codebits | Lisbon | Portugal SAPO Codebits | Lisbon | Portugal

description

Slides of my talk "Why you should be using a distributed version control system (DVCS) for your project", first presented at SAPO CodeBits in Lisbon, Portugal on 2009-12-03.

Transcript of Why you should be using a distributed version control system

Page 1: Why you should be using a distributed version control system

Why you should be using a Why you should be using a distributed version control system distributed version control system

(DVCS) for your project(DVCS) for your project

Lenz Grimmer <Lenz Grimmer <[email protected]>>

http://lenzg.net/ | Twitter: | Twitter: @lenzgr

2009-12-032009-12-03

SAPO Codebits | Lisbon | PortugalSAPO Codebits | Lisbon | Portugal

Page 2: Why you should be using a distributed version control system

Agenda

● Disadvantages of the central approach

● DVCS Concepts and Advantages● Overview: Bazaar, git, Mercurial

Page 3: Why you should be using a distributed version control system

$ whoami

1998 2002

2010?2008

Page 4: Why you should be using a distributed version control system

Disadvantages of the centralized approach

(e.g. Subversion and CVS)

Page 5: Why you should be using a distributed version control system

Most operations require communication with the central

repository

Page 6: Why you should be using a distributed version control system

Checkpointing your work requires committing to the

central repository

Page 7: Why you should be using a distributed version control system

Branching and merging considered painful

Page 8: Why you should be using a distributed version control system

Collaboration is hampered

Page 9: Why you should be using a distributed version control system

DVCS: Concepts and Advantages

Page 10: Why you should be using a distributed version control system

There is no central instance(Well, duh!)

Page 11: Why you should be using a distributed version control system

Disconnected operations

Page 12: Why you should be using a distributed version control system

Local commits

Page 13: Why you should be using a distributed version control system

Easy branching and merging

Page 14: Why you should be using a distributed version control system

Multi-protocol support

Page 15: Why you should be using a distributed version control system

Sample workflows

Page 16: Why you should be using a distributed version control system

Solo Workflow

● Create project● Commit changes● Review/browse

history● Tag/publish release● Apply new changes● Rinse & Repeat

Hack

Page 17: Why you should be using a distributed version control system

Pair programming

Create repository

Branch

HackHackCommit

Pull and merge

Commit

Developer A Developer B

Push, pull, merge

Page 18: Why you should be using a distributed version control system

Code deployment

Upstreamproject

Live site

Developer

Branch

Hack

Commit

MergePush

Page 19: Why you should be using a distributed version control system

Central Branch & Gatekeeper

Central repository Gatekeeper

Developer A Developer B

Branch, Merge,Pull

Edit, Commit,Push

Merge, ReviewPush

Edit, Commit,Push

Page 20: Why you should be using a distributed version control system

Overview: Bazaar, git, Mercurial

Page 21: Why you should be using a distributed version control system

Comparison aspects

● Usability differences● Project hosting sites● OS support● 3rd party tools (e.g. IDE integration, GUIs)● Plugins/Extensibility● Speed● Reference projects● Handling of branches and merges

Page 22: Why you should be using a distributed version control system

Bazaar

● Python● Sponsored by Canonical● Hosting Platforms: Launchpad | Sourceforge● Many plugins● One branch per directory – simplifies the UI● IDE/GUI support● Strong OS support (incl. Windows)● References: Debian apt, awn, Gnash,

MySQL, Ubuntu

Page 23: Why you should be using a distributed version control system

git

● C | Perl | Shell● Originated from the Linux Kernel Community● Speed first, usability later● Powerful, but steeper learning curve● Multiple branches per directory● Platforms: Kenai, github, gitorious,

SourceForge● References: Linux Kernel, Ruby on Rails,

jQuery

Page 24: Why you should be using a distributed version control system

Mercurial

● Python● Plugins● Platforms: Bitbucket, Google Code, Kenai● Multiple branches per directory (named

branches)● A „pull“ updates the repo, not the working

copy● References: NetBeans, OpenJDK,

OpenOffice, OpenSolaris, Python

Page 25: Why you should be using a distributed version control system

Q & A

Questions, Comments?

Page 26: Why you should be using a distributed version control system

Thank you!Lenz Grimmer <[email protected]>