SlideShare una empresa de Scribd logo
1 de 34
Descargar para leer sin conexión
Understanding Distributed Source
            Control
About Me

 • Lorna Jane Mitchell

 • http://lornajane.net

 • PHP Consultant/Developer

 • Open Source project lead http://joind.in

 • Occasional writer/speaker

 • Twitter: @lornajane




                                              2
Source Control
The Aims of Source Control

 • Central keeping-place




                             4
The Aims of Source Control

 • Central keeping-place

 • History of changes




                             4
The Aims of Source Control

 • Central keeping-place

 • History of changes

 • Painless collaboration




                             4
Traditional Centralised Source Control

  • One repository (repo)

  • Working copies

  • Mature

  • Simple

  • Tools:

      • CVS
      • Subversion http://subversion.apache.org/




                                                   5
Traditional Centralised Source Control




                       repo



    checkout         checkout            checkout




                                                    6
Subversion

Recommended centralised solution

Project is now an Apache Software Foundation project. From the mission
statement:


     Subversion exists to be universally recognized and adopted as an
   open-source, centralized version control system characterized by its
reliability as a safe haven for valuable data; the simplicity of its model and
 usage; 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/




                                                                                 7
Centralised Branching Strategies

There are a few common patterns when branching:

  • Version branches

  • Feature branches

  • Live branch




                                                  8
Code Merging with Centralised Systems

 • Make changes

 • Update

 • Commit

 • Merge happens on central repo

 • Can be slow




                                        9
Distributed Source Control

  • 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




                                                  10
Distributed Source Control




                         repo


       repo       repo          repo   repo




                                              11
Distributed Source Control

                     repo


                            repo


              repo


                                   repo


                     repo                 12
The Biggest Change




                     FAST




                            13
Snapshots vs Changesets

A revision number describes a set of patches. Not a state of code.


  With distributed version control, the distributed part is actually not the
 most 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




                                                                               14
Branching on Distributed Systems

 • Can branch any repo

 • Branches can be private




                                   15
Branching on Distributed Systems

 • Can branch any repo

 • Branches can be private

 • Merge commits from other branches on local repo




                                                     15
Working with Branches: Creating


$ git branch api

$ git branch
      api
    * master

$ git checkout api
    Switched to branch 'api'

$ git branch
    * api
      master




                                  16
Working with Branches: Using


$ 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

$ ls
    api
    website




                                                        17
Working with Branches: Switching


$ git checkout master
    Switched to branch 'master'

$ ls
    website




                                   18
Multiple Repositories




              main repo



             remote repo   local




                                   19
Timelines

 • 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




                                               20
Timelines: git log –oneline


be81f69   Merge branch 'master' of git://github.com/joindin/joind.in
a67dabb   Merge commit 'fentie/issue91'
526039d   Merge commit 'jaytaph/JOINDIN-38-2'
0bc1a57   merge of hatfieldje/feature/JOINDIN-100
d3c7195   Added slide icon to talk-list
983d1a0   Fixed dates in CfP display and talk add/edit
4edf8be   Merge commit 'justincarmony/JOINDIN-97'
bec3ac1   Moving the settings from the method to the Controller's member
01d3feb   Admins can approve other admins
31ba4c1   Added counter to Event Claims link
ce2e46b   Updated README. Includes instructions for enabling RewriteEngi
ce356d5   Corrected session type dropbox
9c2f645   Merge commit 'justincarmony/74-howto-block'
0ce1551   Merge remote-tracking branch 'jaytaph/JOINDIN-104'




                                                                     21
Timelines: git log –graph –oneline


*   be81f69 Merge branch 'master' of git://github.com/joindin/joind.in
|
| *    a67dabb Merge commit 'fentie/issue91'
| |
| | * 2b229ef IDE removing extra EOL whitespace
| | * 82b3aa7 switching to single empty test instead of !isset and fal
| | * b03d6df adding check to ensure speakers cannot rate their own ta
| * |    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



                                                                   22
Products and Supporting Tools
GUI Tools

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




                                          24
Bridging the Gap

Bridges: local DVCS functionality with centralised repos

Tools:

   • git-svn

   • bzr-svn

   • hg-git

   • and more




                                                           25
Supporting Distributed Workflows

Need to keep track of:

  • Commits on other repos

  • Relationships between repos

  • Patches (pull requests)




                                  26
Supporting Distributed Workflows

Need to keep track of:

  • Commits on other repos

  • Relationships between repos

  • Patches (pull requests)

Often: source browsing, documentation and issue trackers are also
included




                                                                    26
Collaboration Sites

  • 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




                                                                       27
Understanding Distributed Source Control

  • Differences from centralised systems

  • Tools

  • Gotchas




                                           28
Questions?
Thanks!




 • Slides: http://slideshare.net/lornajane

 • Twitter: @lornajane

 • Web: http://lornajane.net/




                                             30

Más contenido relacionado

La actualidad más candente

Simple Data Automation with Globus (GlobusWorld Tour West)
Simple Data Automation with Globus (GlobusWorld Tour West)Simple Data Automation with Globus (GlobusWorld Tour West)
Simple Data Automation with Globus (GlobusWorld Tour West)Globus
 
Building Ext JS Using HATEOAS - Jeff Stano
Building Ext JS Using HATEOAS - Jeff StanoBuilding Ext JS Using HATEOAS - Jeff Stano
Building Ext JS Using HATEOAS - Jeff StanoSencha
 
Deep Dive: Alfresco Core Repository (... embedded in a micro-services style a...
Deep Dive: Alfresco Core Repository (... embedded in a micro-services style a...Deep Dive: Alfresco Core Repository (... embedded in a micro-services style a...
Deep Dive: Alfresco Core Repository (... embedded in a micro-services style a...J V
 
INF107 - Integrating HCL Domino and Microsoft 365
INF107 - Integrating HCL Domino and Microsoft 365INF107 - Integrating HCL Domino and Microsoft 365
INF107 - Integrating HCL Domino and Microsoft 365Dylan Redfield
 
Survey of restful web services frameworks
Survey of restful web services frameworksSurvey of restful web services frameworks
Survey of restful web services frameworksVijay Prasad Gupta
 
How pulsar stores data at Pulsar-na-summit-2021.pptx (1)
How pulsar stores data at Pulsar-na-summit-2021.pptx (1)How pulsar stores data at Pulsar-na-summit-2021.pptx (1)
How pulsar stores data at Pulsar-na-summit-2021.pptx (1)Shivji Kumar Jha
 
Integrate ManifoldCF with Solr
Integrate ManifoldCF with SolrIntegrate ManifoldCF with Solr
Integrate ManifoldCF with Solrfrancelabs
 
The never-ending REST API design debate -- Devoxx France 2016
The never-ending REST API design debate -- Devoxx France 2016The never-ending REST API design debate -- Devoxx France 2016
The never-ending REST API design debate -- Devoxx France 2016Restlet
 
Server-side Java Programming
Server-side Java ProgrammingServer-side Java Programming
Server-side Java ProgrammingChris Schalk
 
I A+ Open+ Source+ Secret+ Sauce
I A+ Open+ Source+ Secret+ SauceI A+ Open+ Source+ Secret+ Sauce
I A+ Open+ Source+ Secret+ Sauceguest1babda
 
lessons from managing a pulsar cluster
 lessons from managing a pulsar cluster lessons from managing a pulsar cluster
lessons from managing a pulsar clusterShivji Kumar Jha
 
Stack Exchange Infrastructure - LISA 14
Stack Exchange Infrastructure - LISA 14Stack Exchange Infrastructure - LISA 14
Stack Exchange Infrastructure - LISA 14GABeech
 
Common gateway interface
Common gateway interfaceCommon gateway interface
Common gateway interfaceAnandita
 
Soccnx11 Two wrongs don't make a right - Troubleshooting Connections
Soccnx11 Two wrongs don't make a right - Troubleshooting Connections Soccnx11 Two wrongs don't make a right - Troubleshooting Connections
Soccnx11 Two wrongs don't make a right - Troubleshooting Connections Nico Meisenzahl
 
Melbourne User Group OAK and MongoDB
Melbourne User Group OAK and MongoDBMelbourne User Group OAK and MongoDB
Melbourne User Group OAK and MongoDBYuval Ararat
 
SOCCNX11 All you need to know about Orient Me
SOCCNX11 All you need to know about Orient MeSOCCNX11 All you need to know about Orient Me
SOCCNX11 All you need to know about Orient MeNico Meisenzahl
 

La actualidad más candente (20)

Simple Data Automation with Globus (GlobusWorld Tour West)
Simple Data Automation with Globus (GlobusWorld Tour West)Simple Data Automation with Globus (GlobusWorld Tour West)
Simple Data Automation with Globus (GlobusWorld Tour West)
 
What's New in Rails 5
What's New in Rails 5What's New in Rails 5
What's New in Rails 5
 
Webservices ingo
Webservices ingoWebservices ingo
Webservices ingo
 
Building Ext JS Using HATEOAS - Jeff Stano
Building Ext JS Using HATEOAS - Jeff StanoBuilding Ext JS Using HATEOAS - Jeff Stano
Building Ext JS Using HATEOAS - Jeff Stano
 
Deep Dive: Alfresco Core Repository (... embedded in a micro-services style a...
Deep Dive: Alfresco Core Repository (... embedded in a micro-services style a...Deep Dive: Alfresco Core Repository (... embedded in a micro-services style a...
Deep Dive: Alfresco Core Repository (... embedded in a micro-services style a...
 
INF107 - Integrating HCL Domino and Microsoft 365
INF107 - Integrating HCL Domino and Microsoft 365INF107 - Integrating HCL Domino and Microsoft 365
INF107 - Integrating HCL Domino and Microsoft 365
 
Survey of restful web services frameworks
Survey of restful web services frameworksSurvey of restful web services frameworks
Survey of restful web services frameworks
 
How pulsar stores data at Pulsar-na-summit-2021.pptx (1)
How pulsar stores data at Pulsar-na-summit-2021.pptx (1)How pulsar stores data at Pulsar-na-summit-2021.pptx (1)
How pulsar stores data at Pulsar-na-summit-2021.pptx (1)
 
Integrate ManifoldCF with Solr
Integrate ManifoldCF with SolrIntegrate ManifoldCF with Solr
Integrate ManifoldCF with Solr
 
The never-ending REST API design debate -- Devoxx France 2016
The never-ending REST API design debate -- Devoxx France 2016The never-ending REST API design debate -- Devoxx France 2016
The never-ending REST API design debate -- Devoxx France 2016
 
Cgi
CgiCgi
Cgi
 
Server-side Java Programming
Server-side Java ProgrammingServer-side Java Programming
Server-side Java Programming
 
I A+ Open+ Source+ Secret+ Sauce
I A+ Open+ Source+ Secret+ SauceI A+ Open+ Source+ Secret+ Sauce
I A+ Open+ Source+ Secret+ Sauce
 
Soa With Ruby
Soa With RubySoa With Ruby
Soa With Ruby
 
lessons from managing a pulsar cluster
 lessons from managing a pulsar cluster lessons from managing a pulsar cluster
lessons from managing a pulsar cluster
 
Stack Exchange Infrastructure - LISA 14
Stack Exchange Infrastructure - LISA 14Stack Exchange Infrastructure - LISA 14
Stack Exchange Infrastructure - LISA 14
 
Common gateway interface
Common gateway interfaceCommon gateway interface
Common gateway interface
 
Soccnx11 Two wrongs don't make a right - Troubleshooting Connections
Soccnx11 Two wrongs don't make a right - Troubleshooting Connections Soccnx11 Two wrongs don't make a right - Troubleshooting Connections
Soccnx11 Two wrongs don't make a right - Troubleshooting Connections
 
Melbourne User Group OAK and MongoDB
Melbourne User Group OAK and MongoDBMelbourne User Group OAK and MongoDB
Melbourne User Group OAK and MongoDB
 
SOCCNX11 All you need to know about Orient Me
SOCCNX11 All you need to know about Orient MeSOCCNX11 All you need to know about Orient Me
SOCCNX11 All you need to know about Orient Me
 

Similar a Understanding Distributed Source Control

The Source Control Landscape
The Source Control LandscapeThe Source Control Landscape
The Source Control LandscapeLorna Mitchell
 
Git Educated About Git - 20 Essential Commands
Git Educated About Git - 20 Essential CommandsGit Educated About Git - 20 Essential Commands
Git Educated About Git - 20 Essential CommandsJeremy Lindblom
 
SQL Server DevOps Jumpstart
SQL Server DevOps JumpstartSQL Server DevOps Jumpstart
SQL Server DevOps JumpstartOri Donner
 
Git, GitHub and Open Source
Git, GitHub and Open SourceGit, GitHub and Open Source
Git, GitHub and Open SourceLorna Mitchell
 
Embedded Systems: Lecture 10: Introduction to Git & GitHub (Part 1)
Embedded Systems: Lecture 10: Introduction to Git & GitHub (Part 1)Embedded Systems: Lecture 10: Introduction to Git & GitHub (Part 1)
Embedded Systems: Lecture 10: Introduction to Git & GitHub (Part 1)Ahmed El-Arabawy
 
Session: Git Basics & GitFlow Workflow
Session: Git Basics & GitFlow WorkflowSession: Git Basics & GitFlow Workflow
Session: Git Basics & GitFlow WorkflowMidhun Mohanan
 
Git Workflows
Git WorkflowsGit Workflows
Git WorkflowsNoam Kfir
 
Git presentation to some coworkers some time ago
Git presentation to some coworkers some time agoGit presentation to some coworkers some time ago
Git presentation to some coworkers some time agoRodrigo Urubatan
 
Version Control Systems -- Git -- Part I
Version Control Systems -- Git -- Part IVersion Control Systems -- Git -- Part I
Version Control Systems -- Git -- Part ISergey Aganezov
 
Source control - what you need to know
Source control - what you need to knowSource control - what you need to know
Source control - what you need to knowdaveymni
 
Cloud Foundry Roadmap Update - OSCON - May 2017
Cloud Foundry Roadmap Update - OSCON - May 2017Cloud Foundry Roadmap Update - OSCON - May 2017
Cloud Foundry Roadmap Update - OSCON - May 2017Chip Childers
 
Assign, commit, and review - A developer’s guide to OpenStack contribution-20...
Assign, commit, and review - A developer’s guide to OpenStack contribution-20...Assign, commit, and review - A developer’s guide to OpenStack contribution-20...
Assign, commit, and review - A developer’s guide to OpenStack contribution-20...OpenCity Community
 
Git 101: Git and GitHub for Beginners
Git 101: Git and GitHub for Beginners Git 101: Git and GitHub for Beginners
Git 101: Git and GitHub for Beginners HubSpot
 

Similar a Understanding Distributed Source Control (20)

GIT INTRODUCTION
GIT INTRODUCTIONGIT INTRODUCTION
GIT INTRODUCTION
 
The Source Control Landscape
The Source Control LandscapeThe Source Control Landscape
The Source Control Landscape
 
Git Educated About Git - 20 Essential Commands
Git Educated About Git - 20 Essential CommandsGit Educated About Git - 20 Essential Commands
Git Educated About Git - 20 Essential Commands
 
SQL Server DevOps Jumpstart
SQL Server DevOps JumpstartSQL Server DevOps Jumpstart
SQL Server DevOps Jumpstart
 
Git, GitHub and Open Source
Git, GitHub and Open SourceGit, GitHub and Open Source
Git, GitHub and Open Source
 
Embedded Systems: Lecture 10: Introduction to Git & GitHub (Part 1)
Embedded Systems: Lecture 10: Introduction to Git & GitHub (Part 1)Embedded Systems: Lecture 10: Introduction to Git & GitHub (Part 1)
Embedded Systems: Lecture 10: Introduction to Git & GitHub (Part 1)
 
Session: Git Basics & GitFlow Workflow
Session: Git Basics & GitFlow WorkflowSession: Git Basics & GitFlow Workflow
Session: Git Basics & GitFlow Workflow
 
Git Workflows
Git WorkflowsGit Workflows
Git Workflows
 
git Technologies
git Technologiesgit Technologies
git Technologies
 
Git presentation to some coworkers some time ago
Git presentation to some coworkers some time agoGit presentation to some coworkers some time ago
Git presentation to some coworkers some time ago
 
Mini-training: Let’s Git It!
Mini-training: Let’s Git It!Mini-training: Let’s Git It!
Mini-training: Let’s Git It!
 
GIT In Detail
GIT In DetailGIT In Detail
GIT In Detail
 
Version Control Systems -- Git -- Part I
Version Control Systems -- Git -- Part IVersion Control Systems -- Git -- Part I
Version Control Systems -- Git -- Part I
 
Switching to Git
Switching to GitSwitching to Git
Switching to Git
 
Source control - what you need to know
Source control - what you need to knowSource control - what you need to know
Source control - what you need to know
 
Git SVN Migrate Reasons
Git SVN Migrate ReasonsGit SVN Migrate Reasons
Git SVN Migrate Reasons
 
Git & GitHub N00bs
Git & GitHub N00bsGit & GitHub N00bs
Git & GitHub N00bs
 
Cloud Foundry Roadmap Update - OSCON - May 2017
Cloud Foundry Roadmap Update - OSCON - May 2017Cloud Foundry Roadmap Update - OSCON - May 2017
Cloud Foundry Roadmap Update - OSCON - May 2017
 
Assign, commit, and review - A developer’s guide to OpenStack contribution-20...
Assign, commit, and review - A developer’s guide to OpenStack contribution-20...Assign, commit, and review - A developer’s guide to OpenStack contribution-20...
Assign, commit, and review - A developer’s guide to OpenStack contribution-20...
 
Git 101: Git and GitHub for Beginners
Git 101: Git and GitHub for Beginners Git 101: Git and GitHub for Beginners
Git 101: Git and GitHub for Beginners
 

Más de Lorna Mitchell

Web Services PHP Tutorial
Web Services PHP TutorialWeb Services PHP Tutorial
Web Services PHP TutorialLorna Mitchell
 
Business 101 for Developers: Time and Money
Business 101 for Developers: Time and MoneyBusiness 101 for Developers: Time and Money
Business 101 for Developers: Time and MoneyLorna Mitchell
 
Things I wish web graduates knew
Things I wish web graduates knewThings I wish web graduates knew
Things I wish web graduates knewLorna Mitchell
 
Teach a Man To Fish (phpconpl edition)
Teach a Man To Fish (phpconpl edition)Teach a Man To Fish (phpconpl edition)
Teach a Man To Fish (phpconpl edition)Lorna Mitchell
 
Tool Up Your LAMP Stack
Tool Up Your LAMP StackTool Up Your LAMP Stack
Tool Up Your LAMP StackLorna Mitchell
 
Best Practice in Web Service Design
Best Practice in Web Service DesignBest Practice in Web Service Design
Best Practice in Web Service DesignLorna Mitchell
 
Coaching Development Teams: Teach A Man To Fish
Coaching Development Teams: Teach A Man To FishCoaching Development Teams: Teach A Man To Fish
Coaching Development Teams: Teach A Man To FishLorna Mitchell
 
Zend Certification Preparation Tutorial
Zend Certification Preparation TutorialZend Certification Preparation Tutorial
Zend Certification Preparation TutorialLorna Mitchell
 
Implementing OAuth with PHP
Implementing OAuth with PHPImplementing OAuth with PHP
Implementing OAuth with PHPLorna Mitchell
 
Object Oriented Programming in PHP
Object Oriented Programming in PHPObject Oriented Programming in PHP
Object Oriented Programming in PHPLorna Mitchell
 
Could You Telecommute?
Could You Telecommute?Could You Telecommute?
Could You Telecommute?Lorna Mitchell
 
Running a Project with Github
Running a Project with GithubRunning a Project with Github
Running a Project with GithubLorna Mitchell
 
27 Ways To Be A Better Developer
27 Ways To Be A Better Developer27 Ways To Be A Better Developer
27 Ways To Be A Better DeveloperLorna Mitchell
 
Digital Representation
Digital RepresentationDigital Representation
Digital RepresentationLorna Mitchell
 

Más de Lorna Mitchell (20)

Web Services PHP Tutorial
Web Services PHP TutorialWeb Services PHP Tutorial
Web Services PHP Tutorial
 
Business 101 for Developers: Time and Money
Business 101 for Developers: Time and MoneyBusiness 101 for Developers: Time and Money
Business 101 for Developers: Time and Money
 
Things I wish web graduates knew
Things I wish web graduates knewThings I wish web graduates knew
Things I wish web graduates knew
 
Teach a Man To Fish (phpconpl edition)
Teach a Man To Fish (phpconpl edition)Teach a Man To Fish (phpconpl edition)
Teach a Man To Fish (phpconpl edition)
 
Web services tutorial
Web services tutorialWeb services tutorial
Web services tutorial
 
Join In With Joind.In
Join In With Joind.InJoin In With Joind.In
Join In With Joind.In
 
Tool Up Your LAMP Stack
Tool Up Your LAMP StackTool Up Your LAMP Stack
Tool Up Your LAMP Stack
 
Going Freelance
Going FreelanceGoing Freelance
Going Freelance
 
Best Practice in Web Service Design
Best Practice in Web Service DesignBest Practice in Web Service Design
Best Practice in Web Service Design
 
Coaching Development Teams: Teach A Man To Fish
Coaching Development Teams: Teach A Man To FishCoaching Development Teams: Teach A Man To Fish
Coaching Development Teams: Teach A Man To Fish
 
Zend Certification Preparation Tutorial
Zend Certification Preparation TutorialZend Certification Preparation Tutorial
Zend Certification Preparation Tutorial
 
Implementing OAuth with PHP
Implementing OAuth with PHPImplementing OAuth with PHP
Implementing OAuth with PHP
 
Web Services Tutorial
Web Services TutorialWeb Services Tutorial
Web Services Tutorial
 
Object Oriented Programming in PHP
Object Oriented Programming in PHPObject Oriented Programming in PHP
Object Oriented Programming in PHP
 
Example Presentation
Example PresentationExample Presentation
Example Presentation
 
Could You Telecommute?
Could You Telecommute?Could You Telecommute?
Could You Telecommute?
 
Design Patterns
Design PatternsDesign Patterns
Design Patterns
 
Running a Project with Github
Running a Project with GithubRunning a Project with Github
Running a Project with Github
 
27 Ways To Be A Better Developer
27 Ways To Be A Better Developer27 Ways To Be A Better Developer
27 Ways To Be A Better Developer
 
Digital Representation
Digital RepresentationDigital Representation
Digital Representation
 

Understanding Distributed Source Control

  • 2. About Me • Lorna Jane Mitchell • http://lornajane.net • PHP Consultant/Developer • Open Source project lead http://joind.in • Occasional writer/speaker • Twitter: @lornajane 2
  • 4. The Aims of Source Control • Central keeping-place 4
  • 5. The Aims of Source Control • Central keeping-place • History of changes 4
  • 6. The Aims of Source Control • Central keeping-place • History of changes • Painless collaboration 4
  • 7. Traditional Centralised Source Control • One repository (repo) • Working copies • Mature • Simple • Tools: • CVS • Subversion http://subversion.apache.org/ 5
  • 8. Traditional Centralised Source Control repo checkout checkout checkout 6
  • 9. Subversion Recommended centralised solution Project is now an Apache Software Foundation project. From the mission statement: Subversion exists to be universally recognized and adopted as an open-source, centralized version control system characterized by its reliability as a safe haven for valuable data; the simplicity of its model and usage; 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/ 7
  • 10. Centralised Branching Strategies There are a few common patterns when branching: • Version branches • Feature branches • Live branch 8
  • 11. Code Merging with Centralised Systems • Make changes • Update • Commit • Merge happens on central repo • Can be slow 9
  • 12. Distributed Source Control • 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 10
  • 13. Distributed Source Control repo repo repo repo repo 11
  • 14. Distributed Source Control repo repo repo repo repo 12
  • 16. Snapshots vs Changesets A revision number describes a set of patches. Not a state of code. With distributed version control, the distributed part is actually not the most 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 14
  • 17. Branching on Distributed Systems • Can branch any repo • Branches can be private 15
  • 18. Branching on Distributed Systems • Can branch any repo • Branches can be private • Merge commits from other branches on local repo 15
  • 19. Working with Branches: Creating $ git branch api $ git branch api * master $ git checkout api Switched to branch 'api' $ git branch * api master 16
  • 20. Working with Branches: Using $ 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 $ ls api website 17
  • 21. Working with Branches: Switching $ git checkout master Switched to branch 'master' $ ls website 18
  • 22. Multiple Repositories main repo remote repo local 19
  • 23. Timelines • 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 20
  • 24. Timelines: git log –oneline be81f69 Merge branch 'master' of git://github.com/joindin/joind.in a67dabb Merge commit 'fentie/issue91' 526039d Merge commit 'jaytaph/JOINDIN-38-2' 0bc1a57 merge of hatfieldje/feature/JOINDIN-100 d3c7195 Added slide icon to talk-list 983d1a0 Fixed dates in CfP display and talk add/edit 4edf8be Merge commit 'justincarmony/JOINDIN-97' bec3ac1 Moving the settings from the method to the Controller's member 01d3feb Admins can approve other admins 31ba4c1 Added counter to Event Claims link ce2e46b Updated README. Includes instructions for enabling RewriteEngi ce356d5 Corrected session type dropbox 9c2f645 Merge commit 'justincarmony/74-howto-block' 0ce1551 Merge remote-tracking branch 'jaytaph/JOINDIN-104' 21
  • 25. Timelines: git log –graph –oneline * be81f69 Merge branch 'master' of git://github.com/joindin/joind.in | | * a67dabb Merge commit 'fentie/issue91' | | | | * 2b229ef IDE removing extra EOL whitespace | | * 82b3aa7 switching to single empty test instead of !isset and fal | | * b03d6df adding check to ensure speakers cannot rate their own ta | * | 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 22
  • 27. GUI Tools 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 24
  • 28. Bridging the Gap Bridges: local DVCS functionality with centralised repos Tools: • git-svn • bzr-svn • hg-git • and more 25
  • 29. Supporting Distributed Workflows Need to keep track of: • Commits on other repos • Relationships between repos • Patches (pull requests) 26
  • 30. Supporting Distributed Workflows Need to keep track of: • Commits on other repos • Relationships between repos • Patches (pull requests) Often: source browsing, documentation and issue trackers are also included 26
  • 31. Collaboration Sites • 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 27
  • 32. Understanding Distributed Source Control • Differences from centralised systems • Tools • Gotchas 28
  • 34. Thanks! • Slides: http://slideshare.net/lornajane • Twitter: @lornajane • Web: http://lornajane.net/ 30