SlideShare una empresa de Scribd logo
1 de 22
Descargar para leer sin conexión
Getting Started with
      (Distributed) Version Control


     Because what other tools have a blame
                 command?


                 John Paulett
                  jhcore.com


April 3, 2009                                1
Collaboration
Bob adds foo() to main.c while Alice edits
bar() in main.c. How do they merge?



Please do not share code via Windows file
sharing!



April 3, 2009                                2
History
quot;Oops, we screwed up the release, can we
roll back to the last production version?quot;



“Who added this bug?”




April 3, 2009                                3
Backup
quot;The Photoshop keygen gave me a virus.quot;



Sharing files between computers




April 3, 2009                             4
Personally
Open source projects


Personal projects (master's thesis code)


School files (papers, assignments)


Config files (~/.ssh/config, ~/.hgrc)

April 3, 2009                              5
Centeralized vs Decentralized
Cathedral vs Bazaar


Offline commits
          More atomic commits
      ●




Forking is encouraged
          Can keep private until ready
      ●




                                     http://en.wikipedia.org/wiki/index.html?curid=755487
April 3, 2009                                                                      6
VCS Tools
     cp -R project project.old
 ●



     RCS
 ●



     CVS
 ●



     Subversion
 ●



     Perforce
 ●



     Visual SafeSource
 ●



     ClearCase
 ●



     ...
 ●

April 3, 2009                    7
Distributed VCS Tools
       Mercurial              Plastic SCM
   ●                      ●


       Git                    SVK
   ●                      ●


       Bazaar                 Codeville
   ●                      ●


       Monotone               GNU arch
   ●                      ●


       Darcs                  Bitkeeper
   ●                      ●



                              ...
                          ●




April 3, 2009                               8
Which one?
The new “vim vs emacs”




                             http://xkcd.com/378/


(emacs is better)
April 3, 2009                                       9
Mercurial
     OpenJDK
 ●



     Solaris
 ●



     Python
 ●



     Mozilla
 ●



     Netbeans
 ●




April 3, 2009               10
Workflow
 1. Checkout / Start repo
 2. Add / Remove / Edit files
 3. Commit your changes
 4. Push changes
 5. Update / Merge
 6. Go to #2



April 3, 2009                   11
Simple Example
# checkout the repository
hg clone http://bitbucket.org/johnpaulett/python-hl7/


# add the file server.py to be under version control
hg add server.py


# commit the file
hg commit -m quot;Added a single threaded HL7 socket
server.quot;



April 3, 2009                                          12
Simple Example
# Send my changes to bitbucket
hg push


# Pull others' changes from bitbucket
hg pull
hg update


# Merge in anyone else's changes
hg merge


April 3, 2009                           13
Useful Commands
Start a repository:
    hg init my-emr


Find out who changed what in which
version:
    hg blame
    hg log

April 3, 2009                        14
But I Hate the Command Line
TortoiseHg




April 3, 2009                     15
But I Hate the Command Line
MercurialEclipse




April 3, 2009                     16
Being a DVCS Dog
quot;On the Internet, nobody knows that you're
a dog.quot;


hgsubversion
git-svn




April 3, 2009                                   17
                                   New Yorker, 1993
Hosting
     BitBucket (or GitHub for git)
 ●



     Sourceforge
 ●




     hg serve
 ●



     SSH
 ●



     hgweb (via Apache)
 ●




April 3, 2009                        18
April 3, 2009   19
Bad Commit Messages
     Not Atomic
           “Fixed a few bugs in the interface.
           Added an ID field. Removed a couple
           unnecessary functions. Refactored the
           context check.”


     Not Specific
           “Fixed some bugs.”
http://lbrandy.com/blog/2009/03/writing-better-commit-messages/

April 3, 2009                                                     20
Customizing
hgrc
    Set locations, username, plugins



.hgignore
    Ignore unwanted files (*.class, *.pyc,
    *.log)

April 3, 2009                                21
More Info
    http://www.slideshare.net/johnpaulett/getting-started-with-
●

    distributed-version-control
    http://www.selenic.com/mercurial/wiki/
●


    http://betterexplained.com/articles/intro-to-distributed-version-
●

    control-illustrated/
    http://bitbucket.org/
●


    http://joshcarter.com/productivity/svn_hg_git_for_home_directory
●


    http://lbrandy.com/blog/2009/03/writing-better-commit-messages/
●


    http://bitbucket.org/mercurialeclipse/main/wiki/Home
●


    http://bitbucket.org/durin42/hgsubversion/wiki/Home
●


    http://bitbucket.org/tortoisehg/stable/wiki/Home
●




April 3, 2009                                                           22

Más contenido relacionado

La actualidad más candente

La actualidad más candente (20)

Cape Cod Web Technology Meetup - 3
Cape Cod Web Technology Meetup - 3Cape Cod Web Technology Meetup - 3
Cape Cod Web Technology Meetup - 3
 
More than Applications: (Ab)using Docker to Improve the Portability of Everyt...
More than Applications: (Ab)using Docker to Improve the Portability of Everyt...More than Applications: (Ab)using Docker to Improve the Portability of Everyt...
More than Applications: (Ab)using Docker to Improve the Portability of Everyt...
 
SELF 2014: PBI v10: Application Management Made Easy
SELF 2014: PBI v10: Application Management Made EasySELF 2014: PBI v10: Application Management Made Easy
SELF 2014: PBI v10: Application Management Made Easy
 
Build service with_docker_in_90mins
Build service with_docker_in_90minsBuild service with_docker_in_90mins
Build service with_docker_in_90mins
 
Dependency Management with Composer
Dependency Management with ComposerDependency Management with Composer
Dependency Management with Composer
 
DevOps Series: Extending vagrant with Puppet for configuration management
DevOps Series: Extending vagrant with Puppet for configuration managementDevOps Series: Extending vagrant with Puppet for configuration management
DevOps Series: Extending vagrant with Puppet for configuration management
 
Deploying Symfony2 app with Ansible
Deploying Symfony2 app with AnsibleDeploying Symfony2 app with Ansible
Deploying Symfony2 app with Ansible
 
Usando docker en Azure
Usando docker en AzureUsando docker en Azure
Usando docker en Azure
 
Vagrant step-by-step guide for Beginners
Vagrant step-by-step guide for BeginnersVagrant step-by-step guide for Beginners
Vagrant step-by-step guide for Beginners
 
Smiley011
Smiley011Smiley011
Smiley011
 
CloudOpen North America 2013: Vagrant & CFEngine
CloudOpen North America 2013: Vagrant & CFEngineCloudOpen North America 2013: Vagrant & CFEngine
CloudOpen North America 2013: Vagrant & CFEngine
 
Docker and plone
Docker and ploneDocker and plone
Docker and plone
 
Ruby Security the Hard Way
Ruby Security the Hard WayRuby Security the Hard Way
Ruby Security the Hard Way
 
Go & multi platform GUI Trials and Errors
Go & multi platform GUI Trials and ErrorsGo & multi platform GUI Trials and Errors
Go & multi platform GUI Trials and Errors
 
Installation of LAMP Server with Ubuntu 14.10 Server Edition
Installation of LAMP Server with Ubuntu 14.10 Server EditionInstallation of LAMP Server with Ubuntu 14.10 Server Edition
Installation of LAMP Server with Ubuntu 14.10 Server Edition
 
How to configure an environment to cross-compile applications for beagleboard-xM
How to configure an environment to cross-compile applications for beagleboard-xMHow to configure an environment to cross-compile applications for beagleboard-xM
How to configure an environment to cross-compile applications for beagleboard-xM
 
Symfony2 - A Short Introduction
Symfony2 - A Short IntroductionSymfony2 - A Short Introduction
Symfony2 - A Short Introduction
 
DevOps: Docker Workshop
DevOps: Docker WorkshopDevOps: Docker Workshop
DevOps: Docker Workshop
 
Thrift+scribe实现分布式日志收集,并与log4j集成
Thrift+scribe实现分布式日志收集,并与log4j集成Thrift+scribe实现分布式日志收集,并与log4j集成
Thrift+scribe实现分布式日志收集,并与log4j集成
 
Meetup C++ Floripa - Conan.io
Meetup C++ Floripa - Conan.ioMeetup C++ Floripa - Conan.io
Meetup C++ Floripa - Conan.io
 

Similar a Getting Started with (Distributed) Version Control

ITCamp 2013 - Alessandro Pilotti - Git crash course for Visual Studio devs
ITCamp 2013 - Alessandro Pilotti - Git crash course for Visual Studio devsITCamp 2013 - Alessandro Pilotti - Git crash course for Visual Studio devs
ITCamp 2013 - Alessandro Pilotti - Git crash course for Visual Studio devs
ITCamp
 
Jordan Hubbard Talk @ LISA
Jordan Hubbard Talk @ LISAJordan Hubbard Talk @ LISA
Jordan Hubbard Talk @ LISA
guest4c923d
 

Similar a Getting Started with (Distributed) Version Control (20)

Intro To Git
Intro To GitIntro To Git
Intro To Git
 
Becoming Indie
Becoming IndieBecoming Indie
Becoming Indie
 
Composer Power User Tips
Composer Power User TipsComposer Power User Tips
Composer Power User Tips
 
Java IPC and the CLIP library
Java IPC and the CLIP libraryJava IPC and the CLIP library
Java IPC and the CLIP library
 
ITCamp 2013 - Alessandro Pilotti - Git crash course for Visual Studio devs
ITCamp 2013 - Alessandro Pilotti - Git crash course for Visual Studio devsITCamp 2013 - Alessandro Pilotti - Git crash course for Visual Studio devs
ITCamp 2013 - Alessandro Pilotti - Git crash course for Visual Studio devs
 
Welcome to the Symfony2 World - FOSDEM 2013
 Welcome to the Symfony2 World - FOSDEM 2013 Welcome to the Symfony2 World - FOSDEM 2013
Welcome to the Symfony2 World - FOSDEM 2013
 
DCEU 18: Tips and Tricks of the Docker Captains
DCEU 18: Tips and Tricks of the Docker CaptainsDCEU 18: Tips and Tricks of the Docker Captains
DCEU 18: Tips and Tricks of the Docker Captains
 
Jordan Hubbard Talk @ LISA
Jordan Hubbard Talk @ LISAJordan Hubbard Talk @ LISA
Jordan Hubbard Talk @ LISA
 
Docker as an every day work tool
Docker as an every day work toolDocker as an every day work tool
Docker as an every day work tool
 
PostgreSQL Development Today: 9.0
PostgreSQL Development Today: 9.0PostgreSQL Development Today: 9.0
PostgreSQL Development Today: 9.0
 
Happy porting x86 application to android
Happy porting x86 application to androidHappy porting x86 application to android
Happy porting x86 application to android
 
Distributing UI Libraries: in a post Web-Component world
Distributing UI Libraries: in a post Web-Component worldDistributing UI Libraries: in a post Web-Component world
Distributing UI Libraries: in a post Web-Component world
 
A Continuous Packaging Pipeline
A Continuous Packaging PipelineA Continuous Packaging Pipeline
A Continuous Packaging Pipeline
 
Versions
VersionsVersions
Versions
 
Version Control for Mere Mortals
Version Control for Mere MortalsVersion Control for Mere Mortals
Version Control for Mere Mortals
 
Check the version with fixes. Link in description
Check the version with fixes. Link in descriptionCheck the version with fixes. Link in description
Check the version with fixes. Link in description
 
Why Mac Sysadmins Love Python
Why Mac Sysadmins Love PythonWhy Mac Sysadmins Love Python
Why Mac Sysadmins Love Python
 
F3X12 FLOW3 Project Lifecycle
F3X12 FLOW3 Project LifecycleF3X12 FLOW3 Project Lifecycle
F3X12 FLOW3 Project Lifecycle
 
Os dev tool box
Os dev tool boxOs dev tool box
Os dev tool box
 
12 tricks to avoid hackers breaks your CI / CD
12 tricks to avoid hackers breaks your  CI / CD12 tricks to avoid hackers breaks your  CI / CD
12 tricks to avoid hackers breaks your CI / CD
 

Más de John Paulett (8)

GeoDjango & HTML5 Geolocation
GeoDjango & HTML5 GeolocationGeoDjango & HTML5 Geolocation
GeoDjango & HTML5 Geolocation
 
XNAT Case Study: DIAN QC Uploader
XNAT Case Study: DIAN QC UploaderXNAT Case Study: DIAN QC Uploader
XNAT Case Study: DIAN QC Uploader
 
XNAT Open Source Development
XNAT Open Source DevelopmentXNAT Open Source Development
XNAT Open Source Development
 
XNAT Tuning & Monitoring
XNAT Tuning & MonitoringXNAT Tuning & Monitoring
XNAT Tuning & Monitoring
 
Mercurial: Modern Source Control Management
Mercurial: Modern Source Control ManagementMercurial: Modern Source Control Management
Mercurial: Modern Source Control Management
 
PostgreSQL Scaling And Failover
PostgreSQL Scaling And FailoverPostgreSQL Scaling And Failover
PostgreSQL Scaling And Failover
 
Drools
DroolsDrools
Drools
 
Automated Testing
Automated TestingAutomated Testing
Automated Testing
 

Último

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 

Último (20)

What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 

Getting Started with (Distributed) Version Control

  • 1. Getting Started with (Distributed) Version Control Because what other tools have a blame command? John Paulett jhcore.com April 3, 2009 1
  • 2. Collaboration Bob adds foo() to main.c while Alice edits bar() in main.c. How do they merge? Please do not share code via Windows file sharing! April 3, 2009 2
  • 3. History quot;Oops, we screwed up the release, can we roll back to the last production version?quot; “Who added this bug?” April 3, 2009 3
  • 4. Backup quot;The Photoshop keygen gave me a virus.quot; Sharing files between computers April 3, 2009 4
  • 5. Personally Open source projects Personal projects (master's thesis code) School files (papers, assignments) Config files (~/.ssh/config, ~/.hgrc) April 3, 2009 5
  • 6. Centeralized vs Decentralized Cathedral vs Bazaar Offline commits More atomic commits ● Forking is encouraged Can keep private until ready ● http://en.wikipedia.org/wiki/index.html?curid=755487 April 3, 2009 6
  • 7. VCS Tools cp -R project project.old ● RCS ● CVS ● Subversion ● Perforce ● Visual SafeSource ● ClearCase ● ... ● April 3, 2009 7
  • 8. Distributed VCS Tools Mercurial Plastic SCM ● ● Git SVK ● ● Bazaar Codeville ● ● Monotone GNU arch ● ● Darcs Bitkeeper ● ● ... ● April 3, 2009 8
  • 9. Which one? The new “vim vs emacs” http://xkcd.com/378/ (emacs is better) April 3, 2009 9
  • 10. Mercurial OpenJDK ● Solaris ● Python ● Mozilla ● Netbeans ● April 3, 2009 10
  • 11. Workflow 1. Checkout / Start repo 2. Add / Remove / Edit files 3. Commit your changes 4. Push changes 5. Update / Merge 6. Go to #2 April 3, 2009 11
  • 12. Simple Example # checkout the repository hg clone http://bitbucket.org/johnpaulett/python-hl7/ # add the file server.py to be under version control hg add server.py # commit the file hg commit -m quot;Added a single threaded HL7 socket server.quot; April 3, 2009 12
  • 13. Simple Example # Send my changes to bitbucket hg push # Pull others' changes from bitbucket hg pull hg update # Merge in anyone else's changes hg merge April 3, 2009 13
  • 14. Useful Commands Start a repository: hg init my-emr Find out who changed what in which version: hg blame hg log April 3, 2009 14
  • 15. But I Hate the Command Line TortoiseHg April 3, 2009 15
  • 16. But I Hate the Command Line MercurialEclipse April 3, 2009 16
  • 17. Being a DVCS Dog quot;On the Internet, nobody knows that you're a dog.quot; hgsubversion git-svn April 3, 2009 17 New Yorker, 1993
  • 18. Hosting BitBucket (or GitHub for git) ● Sourceforge ● hg serve ● SSH ● hgweb (via Apache) ● April 3, 2009 18
  • 20. Bad Commit Messages Not Atomic “Fixed a few bugs in the interface. Added an ID field. Removed a couple unnecessary functions. Refactored the context check.” Not Specific “Fixed some bugs.” http://lbrandy.com/blog/2009/03/writing-better-commit-messages/ April 3, 2009 20
  • 21. Customizing hgrc Set locations, username, plugins .hgignore Ignore unwanted files (*.class, *.pyc, *.log) April 3, 2009 21
  • 22. More Info http://www.slideshare.net/johnpaulett/getting-started-with- ● distributed-version-control http://www.selenic.com/mercurial/wiki/ ● http://betterexplained.com/articles/intro-to-distributed-version- ● control-illustrated/ http://bitbucket.org/ ● http://joshcarter.com/productivity/svn_hg_git_for_home_directory ● http://lbrandy.com/blog/2009/03/writing-better-commit-messages/ ● http://bitbucket.org/mercurialeclipse/main/wiki/Home ● http://bitbucket.org/durin42/hgsubversion/wiki/Home ● http://bitbucket.org/tortoisehg/stable/wiki/Home ● April 3, 2009 22