understanding distributed source control
TRANSCRIPT
![Page 1: Understanding Distributed Source Control](https://reader034.vdocuments.mx/reader034/viewer/2022052523/5555d259d8b42aaf158b4daa/html5/thumbnails/1.jpg)
Understanding Distributed SourceControl
![Page 2: Understanding Distributed Source Control](https://reader034.vdocuments.mx/reader034/viewer/2022052523/5555d259d8b42aaf158b4daa/html5/thumbnails/2.jpg)
About Me
2
• Lorna Jane Mitchell
• http://lornajane.net
• PHP Consultant/Developer
• Open Source project lead http://joind.in
• Occasional writer/speaker
• Twitter: @lornajane
![Page 3: Understanding Distributed Source Control](https://reader034.vdocuments.mx/reader034/viewer/2022052523/5555d259d8b42aaf158b4daa/html5/thumbnails/3.jpg)
Source Control
![Page 4: Understanding Distributed Source Control](https://reader034.vdocuments.mx/reader034/viewer/2022052523/5555d259d8b42aaf158b4daa/html5/thumbnails/4.jpg)
The Aims of Source Control
4
• Central keeping-place
![Page 5: Understanding Distributed Source Control](https://reader034.vdocuments.mx/reader034/viewer/2022052523/5555d259d8b42aaf158b4daa/html5/thumbnails/5.jpg)
The Aims of Source Control
4
• Central keeping-place
• History of changes
![Page 6: Understanding Distributed Source Control](https://reader034.vdocuments.mx/reader034/viewer/2022052523/5555d259d8b42aaf158b4daa/html5/thumbnails/6.jpg)
The Aims of Source Control
4
• Central keeping-place
• History of changes
• Painless collaboration
![Page 7: Understanding Distributed Source Control](https://reader034.vdocuments.mx/reader034/viewer/2022052523/5555d259d8b42aaf158b4daa/html5/thumbnails/7.jpg)
Traditional Centralised Source Control
5
• One repository (repo)
• Working copies
• Mature
• Simple
• Tools:
• CVS
• Subversion http://subversion.apache.org/
![Page 8: Understanding Distributed Source Control](https://reader034.vdocuments.mx/reader034/viewer/2022052523/5555d259d8b42aaf158b4daa/html5/thumbnails/8.jpg)
Traditional Centralised Source Control
6
repo
checkout checkoutcheckout
![Page 9: Understanding Distributed Source Control](https://reader034.vdocuments.mx/reader034/viewer/2022052523/5555d259d8b42aaf158b4daa/html5/thumbnails/9.jpg)
Subversion
7
Recommended centralised solution
Project is now an Apache Software Foundation project. From the missionstatement:
Subversion exists to be universally recognized and adopted as anopen-source, centralized version control system characterized by its
reliability as a safe haven for valuable data; the simplicity of its model andusage; and its ability to support the needs of a wide variety of users and
projects, from individuals to large-scale enterprise operations.
http://lwn.net/Articles/381794/
![Page 10: Understanding Distributed Source Control](https://reader034.vdocuments.mx/reader034/viewer/2022052523/5555d259d8b42aaf158b4daa/html5/thumbnails/10.jpg)
Centralised Branching Strategies
8
There are a few common patterns when branching:
• Version branches
• Feature branches
• Live branch
![Page 11: Understanding Distributed Source Control](https://reader034.vdocuments.mx/reader034/viewer/2022052523/5555d259d8b42aaf158b4daa/html5/thumbnails/11.jpg)
Code Merging with Centralised Systems
9
• Make changes
• Update
• Commit
• Merge happens on central repo
• Can be slow
![Page 12: Understanding Distributed Source Control](https://reader034.vdocuments.mx/reader034/viewer/2022052523/5555d259d8b42aaf158b4daa/html5/thumbnails/12.jpg)
Distributed Source Control
10
• Many repos
• Local repo
• Tools (all with comparable features)
• Git http://git-scm.com/
• Mercurial http://mercurial.selenic.com/
• Bazaar http://bazaar.canonical.com/
• Powerful/complex
![Page 13: Understanding Distributed Source Control](https://reader034.vdocuments.mx/reader034/viewer/2022052523/5555d259d8b42aaf158b4daa/html5/thumbnails/13.jpg)
Distributed Source Control
11
repo
repo reporepo repo
![Page 14: Understanding Distributed Source Control](https://reader034.vdocuments.mx/reader034/viewer/2022052523/5555d259d8b42aaf158b4daa/html5/thumbnails/14.jpg)
Distributed Source Control
12
repo
repo
repo
repo
repo
![Page 15: Understanding Distributed Source Control](https://reader034.vdocuments.mx/reader034/viewer/2022052523/5555d259d8b42aaf158b4daa/html5/thumbnails/15.jpg)
The Biggest Change
13
FAST
![Page 16: Understanding Distributed Source Control](https://reader034.vdocuments.mx/reader034/viewer/2022052523/5555d259d8b42aaf158b4daa/html5/thumbnails/16.jpg)
Snapshots vs Changesets
14
A revision number describes a set of patches. Not a state of code.
With distributed version control, the distributed part is actually not themost interesting part. The interesting part is that these systems think in
terms of changes, not in terms of versions
http://www.joelonsoftware.com/items/2010/03/17.html
![Page 17: Understanding Distributed Source Control](https://reader034.vdocuments.mx/reader034/viewer/2022052523/5555d259d8b42aaf158b4daa/html5/thumbnails/17.jpg)
Branching on Distributed Systems
15
• Can branch any repo
• Branches can be private
![Page 18: Understanding Distributed Source Control](https://reader034.vdocuments.mx/reader034/viewer/2022052523/5555d259d8b42aaf158b4daa/html5/thumbnails/18.jpg)
Branching on Distributed Systems
15
• Can branch any repo
• Branches can be private
• Merge commits from other branches on local repo
![Page 19: Understanding Distributed Source Control](https://reader034.vdocuments.mx/reader034/viewer/2022052523/5555d259d8b42aaf158b4daa/html5/thumbnails/19.jpg)
Working with Branches: Creating
16
$ git branch api
$ git branchapi
* master
$ git checkout apiSwitched to branch 'api'
$ git branch
* apimaster
![Page 20: Understanding Distributed Source Control](https://reader034.vdocuments.mx/reader034/viewer/2022052523/5555d259d8b42aaf158b4daa/html5/thumbnails/20.jpg)
Working with Branches: Using
17
$ mkdir api$ vim api/index.php$ git add api/
$ git commit -m "added the web service"[api 62582e1] added the web service
1 files changed, 4 insertions(+), 0 deletions(-)create mode 100644 api/index.php
$ lsapiwebsite
![Page 21: Understanding Distributed Source Control](https://reader034.vdocuments.mx/reader034/viewer/2022052523/5555d259d8b42aaf158b4daa/html5/thumbnails/21.jpg)
Working with Branches: Switching
18
$ git checkout masterSwitched to branch 'master'
$ lswebsite
![Page 22: Understanding Distributed Source Control](https://reader034.vdocuments.mx/reader034/viewer/2022052523/5555d259d8b42aaf158b4daa/html5/thumbnails/22.jpg)
Multiple Repositories
19
remote repo
main repo
local
![Page 23: Understanding Distributed Source Control](https://reader034.vdocuments.mx/reader034/viewer/2022052523/5555d259d8b42aaf158b4daa/html5/thumbnails/23.jpg)
Timelines
20
• Commits keep their timestamps
• They show at the time they were commited
• To a repo
• Not when they were merged to this one
• Tools help illustrate
![Page 24: Understanding Distributed Source Control](https://reader034.vdocuments.mx/reader034/viewer/2022052523/5555d259d8b42aaf158b4daa/html5/thumbnails/24.jpg)
Timelines: git log –oneline
21
be81f69 Merge branch 'master' of git://github.com/joindi n/joind.ina67dabb Merge commit 'fentie/issue91'526039d Merge commit 'jaytaph/JOINDIN-38-2'0bc1a57 merge of hatfieldje/feature/JOINDIN-100d3c7195 Added slide icon to talk-list983d1a0 Fixed dates in CfP display and talk add/edit4edf8be Merge commit 'justincarmony/JOINDIN-97'bec3ac1 Moving the settings from the method to the Controlle r's members01d3feb Admins can approve other admins31ba4c1 Added counter to Event Claims linkce2e46b Updated README. Includes instructions for enablin g RewriteEnginece356d5 Corrected session type dropbox9c2f645 Merge commit 'justincarmony/74-howto-block'0ce1551 Merge remote-tracking branch 'jaytaph/JOINDIN-1 04'
![Page 25: Understanding Distributed Source Control](https://reader034.vdocuments.mx/reader034/viewer/2022052523/5555d259d8b42aaf158b4daa/html5/thumbnails/25.jpg)
Timelines: git log –graph –oneline
22
* be81f69 Merge branch 'master' of git://github.com/joindi n/joind.in|\| * a67dabb Merge commit 'fentie/issue91'| |\| | * 2b229ef IDE removing extra EOL whitespace| | * 82b3aa7 switching to single empty test instead of !isset and false| | * b03d6df adding check to ensure speakers cannot rate their ow n talks| * | 526039d Merge commit 'jaytaph/JOINDIN-38-2'| |\ \| | * | 01d3feb Admins can approve other admins| | * | 31ba4c1 Added counter to Event Claims link| * | | 0bc1a57 merge of hatfieldje/feature/JOINDIN-100| |\ \ \| | * | | 983d1a0 Fixed dates in CfP display and talk add/edit| | * | | 0ddfd83 JOINDIN-100| | * | | d00e1f3 feature/JOINDIN-100| | * | | f5a5775 feature/JOINDIN-100| * | | | d3c7195 Added slide icon to talk-list
![Page 26: Understanding Distributed Source Control](https://reader034.vdocuments.mx/reader034/viewer/2022052523/5555d259d8b42aaf158b4daa/html5/thumbnails/26.jpg)
Products and Supporting Tools
![Page 27: Understanding Distributed Source Control](https://reader034.vdocuments.mx/reader034/viewer/2022052523/5555d259d8b42aaf158b4daa/html5/thumbnails/27.jpg)
GUI Tools
24
Most OS/DVCS combinations covered
• IDE plugins
• Versions on OS X for SVN
• Tower on OS X for git
• Tortoise* for Windows users
• git and windows not recommended
• CLI on every platform
![Page 28: Understanding Distributed Source Control](https://reader034.vdocuments.mx/reader034/viewer/2022052523/5555d259d8b42aaf158b4daa/html5/thumbnails/28.jpg)
Bridging the Gap
25
Bridges: local DVCS functionality with centralised repos
Tools:
• git-svn
• bzr-svn
• hg-git
• and more
![Page 29: Understanding Distributed Source Control](https://reader034.vdocuments.mx/reader034/viewer/2022052523/5555d259d8b42aaf158b4daa/html5/thumbnails/29.jpg)
Supporting Distributed Workflows
26
Need to keep track of:
• Commits on other repos
• Relationships between repos
• Patches (pull requests)
![Page 30: Understanding Distributed Source Control](https://reader034.vdocuments.mx/reader034/viewer/2022052523/5555d259d8b42aaf158b4daa/html5/thumbnails/30.jpg)
Supporting Distributed Workflows
26
Need to keep track of:
• Commits on other repos
• Relationships between repos
• Patches (pull requests)
Often: source browsing, documentation and issue trackers are alsoincluded
![Page 31: Understanding Distributed Source Control](https://reader034.vdocuments.mx/reader034/viewer/2022052523/5555d259d8b42aaf158b4daa/html5/thumbnails/31.jpg)
Collaboration Sites
27
• Git
• Github http://github.com/
• Gitorious http://gitorious.org/
• Mercurial
• Bitbucket http://bitbucket.org/
• Bazaar
• Launchpad http://launchpad.net/
Also Sourceforge who support all of the above and more http://sf.net
![Page 32: Understanding Distributed Source Control](https://reader034.vdocuments.mx/reader034/viewer/2022052523/5555d259d8b42aaf158b4daa/html5/thumbnails/32.jpg)
Understanding Distributed Source Control
28
• Differences from centralised systems
• Tools
• Gotchas
![Page 33: Understanding Distributed Source Control](https://reader034.vdocuments.mx/reader034/viewer/2022052523/5555d259d8b42aaf158b4daa/html5/thumbnails/33.jpg)
Questions?
![Page 34: Understanding Distributed Source Control](https://reader034.vdocuments.mx/reader034/viewer/2022052523/5555d259d8b42aaf158b4daa/html5/thumbnails/34.jpg)
Thanks!
30
• Slides: http://slideshare.net/lornajane
• Twitter: @lornajane
• Web: http://lornajane.net/