SlideShare a Scribd company logo
1 of 36
Download to read offline
GIT VS. SVN
Which one should we use and when?
http://www.paradigmatecnologico.com
@paradigmate
http://marianonavas.me
@marianongdev
What is a CVS for?
• Allow team work together and collaborate
• Have some kind of time machine in our code
• Allow CI
Approaches (architectural models)
• Local
• Rcs (Mac OS Developer Tools)
• Centralized
• Subversion
• CVS
• Perforce
• Distributed
• Git
• Mercurial
Approaches (architectural models)
• Local
• Rcs (Mac OS Developer Tools)
• Centralized
• Subversion
• CVS
• Perforce
• Distributed
• Git
• Mercurial
Very good resource
Centralized CVS
Distributed CVS
Centralized
• Pros
• Looks simple
• We know it well; we've been using it for a long time
• Good mainstream IDEs integration
• It works 
• Cons
• We cannot commit offline (well, we can, but …)
• We cannot integrate in our development toolset more than one
repository
• Dificult to collaborate if team is large (i.e. open source projects)
• We are encouraged to avoid branches by the system.
Distributed
• Pros
• Allow offline work
• Easy collaboration model
• Can link as many repositories as we might need
• Almost every operation is local
• Complete copy of the repository in each machine
• Easy installation on server, and plenty of hosting services (free and
paid)
• Cons
• More complex workflow (or not?)
• Difficult to learn
• ?????
Internal representation of data; SVN
Branching in SVN
Branching in SVN
Quotes taken from official svn website
• "For projects that have a large number of contributors, it's common for
most people to have working copies of the trunk. Whenever someone
needs to make a long-running change that is likely to disrupt the
trunk, a standard procedure is to create a private branch and commit
changes there until all the work is complete"
• "The bad news is that it's very easy to drift too far apart (...) it may be
near-impossible to merge your changes back into the trunk without a
huge number of conflicts"
• "Subversion gives you the ability to selectively “copy” changes
between branches. And when you're completely finished with your
branch, your entire set of branch changes can be copied back into the
trunk. In Subversion terminology, the general act of replicating
changes from one branch to another is called merging, and it is
performed using various invocations of the svn merge subcommand”
Branching in SVN I (typical workflow)
• Checkout from trunk.
• Add a new file to working copy
• Check status (svn st).
• Track new file in svn (svn add).
• Commit the new file (svn ci).
• Modify the file, and check status again (svn st).
• Commit the new change.
• Modify again and let it remain modified.
Branching in SVN II (branch & merge)
• Svn copy at server level.
• Check current working copy remote path (svn info).
• Switch to new location (svn switch [remote] .)
• Check remote again (svn info).
• Commit some change to the branch.
• Switch again to trunk.
• Merge trunk with [myNewBranch] (svn merge [source@rev] .).
Note that we do it with the working copy first to merge conflicts
locally.
• Commit to finish merge (we’ve done it locally in the previous
step).
• Again with a non-conflicting change in the same file.
• Again with a conflicting change.
Internal representation of data; svn
• Repository: the main idea
• Working copy
• Revisions, which are deltas of a base state
• The server has to workout deltas to resolve the concrete
state of a revision (commit)
• Each revision gets a unique (secuential) id. This is
possible because it's centralized
• Branches: are light copies of complete working trees
• Summary: branch=copy.
Drawbacks I: only one remote
Drawbacks II: branch & merge sucks
• Recall branch & merge procedure:
• Copy trunk in branch directory in remote server
• Checkout (or switch) locally.
• Inspect revision we want to merge with, if not last.
• Call svn merge.
• Resolve conflicts (if any).
• Commit the whole thing.
• In practice we feel encouraged to not create branches
(bad, bad, bad …).
Drawback III: cleanliness
• What if I want to merge my branch just to get up to date
with our trunk, but I don’t want to make it public yet
(incomplete feature or just playing around)?
Drawback IV: privacy
• Do I have to publish my code to a remote/public server to
have version control? What if I’m doing some experiments
I don’t want other people to see, or I just don’t want to
mess up our central repository with something I don’t
know if it’s going to work?
Internal representation of data; git
Git – file status lifecycle
Git internal storage structure: directed
acyclic graph (DAG)
• http://eagain.net/articles/git-for-computer-scientists/
Branching in git
Deeper insight in git DAG internal
structure
Another view of git objects I
Another view of git objects II
Another view of git objects III
Details on how git stores that in disk
• http://git-scm.com/book/en/Git-Internals-Git-Objects
Branches and HEAD
More on git internal representation of data
• http://eagain.net/articles/git-for-computer-scientists/
• http://en.wikipedia.org/wiki/Directed_acyclic_graph
• Due to its distributed nature unique ids for commits are
generated as SHA-1 digest to ensure unicity
• Explanation
• Snapshots, not deltas
• Commits: blobs
• Branches: references to commits
• Repeat: branch = pointer
• Current branch: HEAD pointer
• Detached heads: careful
SVN branch & merge summary
• SVN has no branch concept. It's just another working
copy with a common history
• We can only merge two branches at a time
• SVN allow you to merge even not at all related trees
(error prone)
• Refactor and moving things around; svn doesn't manage
this kind of merges very well
• Only allows interaction one repository at a time.
Git branch & merge summary
• It’s trivial to create a new branch from any point.
• Git prevents us from deleting unmerged branches.
• We can clean up obsolete branches keeping commits.
• We can move a branch around (recreate it from any
starting point).
• We can merge more than one branch at a time (3 or even
more!!!).
• Git understands moved and renamed files.
• This model encourage best practices: branch-per-feature,
local branches for testing and experiments, git-flow …
Git allow us to manage branching well
Git integration with SVN
Interesting git resource
• http://git-scm.com
• http://git-scm.com/docs/gittutorial
• http://eagain.net/articles/git-for-computer-scientists/
• http://try.github.io/levels/1/challenges/1
• http://www.vogella.com/articles/Git/article.html
• https://help.github.com/articles/
• http://gitimmersion.com
Wich CVS should I choose and when?

More Related Content

What's hot

What's hot (20)

Git vs. Mercurial
Git vs. MercurialGit vs. Mercurial
Git vs. Mercurial
 
Using Subversion and Git Together
Using Subversion and Git TogetherUsing Subversion and Git Together
Using Subversion and Git Together
 
Getting started with git svn
Getting started with git svnGetting started with git svn
Getting started with git svn
 
Introduction to git
Introduction to gitIntroduction to git
Introduction to git
 
Source Code Management systems
Source Code Management systemsSource Code Management systems
Source Code Management systems
 
Collaborative development with Git | Workshop
Collaborative development with Git | WorkshopCollaborative development with Git | Workshop
Collaborative development with Git | Workshop
 
Git
GitGit
Git
 
Subversion in a distributed world
Subversion in a distributed worldSubversion in a distributed world
Subversion in a distributed world
 
Git introduction workshop for scientists
Git introduction workshop for scientists Git introduction workshop for scientists
Git introduction workshop for scientists
 
Kubernetes Introduction
Kubernetes IntroductionKubernetes Introduction
Kubernetes Introduction
 
Version Control Systems with git (and github) as an example
Version Control Systems with git (and github) as an exampleVersion Control Systems with git (and github) as an example
Version Control Systems with git (and github) as an example
 
Git presentation, Viktor Pyskunov
Git presentation, Viktor PyskunovGit presentation, Viktor Pyskunov
Git presentation, Viktor Pyskunov
 
Advanced Git Techniques: Subtrees, Grafting, and Other Fun Stuff
Advanced Git Techniques: Subtrees, Grafting, and Other Fun StuffAdvanced Git Techniques: Subtrees, Grafting, and Other Fun Stuff
Advanced Git Techniques: Subtrees, Grafting, and Other Fun Stuff
 
Git in 5 Minutes
Git in 5 MinutesGit in 5 Minutes
Git in 5 Minutes
 
kubernetes for beginners
kubernetes for beginnerskubernetes for beginners
kubernetes for beginners
 
From Docker To Kubernetes: A Developer's Guide To Containers - Mandy White - ...
From Docker To Kubernetes: A Developer's Guide To Containers - Mandy White - ...From Docker To Kubernetes: A Developer's Guide To Containers - Mandy White - ...
From Docker To Kubernetes: A Developer's Guide To Containers - Mandy White - ...
 
Kubernetes Basics
Kubernetes BasicsKubernetes Basics
Kubernetes Basics
 
Effective Git
Effective GitEffective Git
Effective Git
 
Introduction to Kubernetes
Introduction to KubernetesIntroduction to Kubernetes
Introduction to Kubernetes
 
Fabric8 CI/CD
Fabric8 CI/CDFabric8 CI/CD
Fabric8 CI/CD
 

Viewers also liked

Quick Introduction to git
Quick Introduction to gitQuick Introduction to git
Quick Introduction to git
Joel Krebs
 

Viewers also liked (14)

Tech thursdays / GIT
Tech thursdays / GITTech thursdays / GIT
Tech thursdays / GIT
 
Learning git
Learning gitLearning git
Learning git
 
Version control with GIT
Version control with GITVersion control with GIT
Version control with GIT
 
JAZOON'13 - Bartosz Majsak - Git Workshop - Kung Fu
JAZOON'13 - Bartosz Majsak - Git Workshop - Kung FuJAZOON'13 - Bartosz Majsak - Git Workshop - Kung Fu
JAZOON'13 - Bartosz Majsak - Git Workshop - Kung Fu
 
A proven path for migrating from clearcase to git and or subversion
A proven path for migrating from clearcase to git and or subversionA proven path for migrating from clearcase to git and or subversion
A proven path for migrating from clearcase to git and or subversion
 
Git
GitGit
Git
 
Git Introduction
Git IntroductionGit Introduction
Git Introduction
 
Introduction to Git
Introduction to GitIntroduction to Git
Introduction to Git
 
Intro To Git
Intro To GitIntro To Git
Intro To Git
 
Git Presentation
Git PresentationGit Presentation
Git Presentation
 
Getting Git
Getting GitGetting Git
Getting Git
 
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
 
Git vs SVN
Git vs SVNGit vs SVN
Git vs SVN
 
Quick Introduction to git
Quick Introduction to gitQuick Introduction to git
Quick Introduction to git
 

Similar to Git vs Subversion: ¿Cuando elegir uno u otro?

Slide set 7 (Source Code Management History Overview) - Copy.pptx
Slide set 7 (Source Code Management History  Overview) - Copy.pptxSlide set 7 (Source Code Management History  Overview) - Copy.pptx
Slide set 7 (Source Code Management History Overview) - Copy.pptx
UTKARSHBHARDWAJ71
 
Beginner's Guide to Version Control with Git
Beginner's Guide to Version Control with GitBeginner's Guide to Version Control with Git
Beginner's Guide to Version Control with Git
Robert Lee-Cann
 

Similar to Git vs Subversion: ¿Cuando elegir uno u otro? (20)

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)
 
SVN Tool Information : Best Practices
SVN Tool Information  : Best PracticesSVN Tool Information  : Best Practices
SVN Tool Information : Best Practices
 
SVN Information
SVN Information  SVN Information
SVN Information
 
Source version control using subversion
Source version control using subversionSource version control using subversion
Source version control using subversion
 
GIT In Detail
GIT In DetailGIT In Detail
GIT In Detail
 
Git and GitHub
Git and GitHubGit and GitHub
Git and GitHub
 
GIT INTRODUCTION
GIT INTRODUCTIONGIT INTRODUCTION
GIT INTRODUCTION
 
Git
GitGit
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
 
Working with Git
Working with GitWorking with Git
Working with Git
 
An introduction to Git and GitFlow
An introduction to Git and GitFlowAn introduction to Git and GitFlow
An introduction to Git and GitFlow
 
Git
GitGit
Git
 
Git more done
Git more doneGit more done
Git more done
 
Slide set 7 (Source Code Management History Overview) - Copy.pptx
Slide set 7 (Source Code Management History  Overview) - Copy.pptxSlide set 7 (Source Code Management History  Overview) - Copy.pptx
Slide set 7 (Source Code Management History Overview) - Copy.pptx
 
Beginner's Guide to Version Control with Git
Beginner's Guide to Version Control with GitBeginner's Guide to Version Control with Git
Beginner's Guide to Version Control with Git
 
Make It Cooler: Using Decentralized Version Control
Make It Cooler: Using Decentralized Version ControlMake It Cooler: Using Decentralized Version Control
Make It Cooler: Using Decentralized Version Control
 
Introduction to git
Introduction to gitIntroduction to git
Introduction to git
 
Gitlikeapro 2019
Gitlikeapro 2019Gitlikeapro 2019
Gitlikeapro 2019
 
Version Control Systems -- Git -- Part I
Version Control Systems -- Git -- Part IVersion Control Systems -- Git -- Part I
Version Control Systems -- Git -- Part I
 
Git essential training & sharing self
Git essential training & sharing selfGit essential training & sharing self
Git essential training & sharing self
 

More from Paradigma Digital

More from Paradigma Digital (20)

Ddd + ah + microservicios
Ddd + ah + microserviciosDdd + ah + microservicios
Ddd + ah + microservicios
 
Bots 3.0: Dejando atrás los bots conversacionales con Dialogflow.
Bots 3.0: Dejando atrás los bots conversacionales con Dialogflow.Bots 3.0: Dejando atrás los bots conversacionales con Dialogflow.
Bots 3.0: Dejando atrás los bots conversacionales con Dialogflow.
 
Have you met Istio?
Have you met Istio?Have you met Istio?
Have you met Istio?
 
Linkerd a fondo
Linkerd a fondoLinkerd a fondo
Linkerd a fondo
 
Horneando apis
Horneando apisHorneando apis
Horneando apis
 
Java 8 time to join the future
Java 8  time to join the futureJava 8  time to join the future
Java 8 time to join the future
 
Programación Reactiva con Spring WebFlux
Programación Reactiva con Spring WebFluxProgramación Reactiva con Spring WebFlux
Programación Reactiva con Spring WebFlux
 
Orquestando microservicios como lo hace Netflix
Orquestando microservicios como lo hace NetflixOrquestando microservicios como lo hace Netflix
Orquestando microservicios como lo hace Netflix
 
Meetup microservicios: API Management
Meetup microservicios: API ManagementMeetup microservicios: API Management
Meetup microservicios: API Management
 
Meetup de kubernetes, conceptos básicos.
Meetup  de kubernetes, conceptos básicos.Meetup  de kubernetes, conceptos básicos.
Meetup de kubernetes, conceptos básicos.
 
Docker, kubernetes, openshift y openstack, para mi abuela. techfest 2017.pptx
Docker, kubernetes, openshift y openstack, para mi abuela. techfest 2017.pptxDocker, kubernetes, openshift y openstack, para mi abuela. techfest 2017.pptx
Docker, kubernetes, openshift y openstack, para mi abuela. techfest 2017.pptx
 
Implementando microservicios
Implementando microserviciosImplementando microservicios
Implementando microservicios
 
Equipo de Marketing de Paradigma Digital
Equipo de Marketing de Paradigma DigitalEquipo de Marketing de Paradigma Digital
Equipo de Marketing de Paradigma Digital
 
¿Cómo se despliega y autoescala Couchbase en Cloud? ¡Aprende de manera práctica!
¿Cómo se despliega y autoescala Couchbase en Cloud? ¡Aprende de manera práctica!¿Cómo se despliega y autoescala Couchbase en Cloud? ¡Aprende de manera práctica!
¿Cómo se despliega y autoescala Couchbase en Cloud? ¡Aprende de manera práctica!
 
Overview atlas (1)
Overview atlas (1)Overview atlas (1)
Overview atlas (1)
 
Cómo usar google analytics
Cómo usar google analyticsCómo usar google analytics
Cómo usar google analytics
 
Transformación Digital
Transformación DigitalTransformación Digital
Transformación Digital
 
Manuel Hurtado. Couchbase paradigma4oct
Manuel Hurtado. Couchbase paradigma4octManuel Hurtado. Couchbase paradigma4oct
Manuel Hurtado. Couchbase paradigma4oct
 
Programación Reactiva con RxJava
Programación Reactiva con RxJavaProgramación Reactiva con RxJava
Programación Reactiva con RxJava
 
¿Cómo vencer a los dragones digitales?
¿Cómo vencer a los dragones digitales?¿Cómo vencer a los dragones digitales?
¿Cómo vencer a los dragones digitales?
 

Recently uploaded

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Recently uploaded (20)

Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
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...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024Top 10 Most Downloaded Games on Play Store in 2024
Top 10 Most Downloaded Games on Play Store in 2024
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
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
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
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...
 
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
 
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...
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 

Git vs Subversion: ¿Cuando elegir uno u otro?

  • 1. GIT VS. SVN Which one should we use and when? http://www.paradigmatecnologico.com @paradigmate http://marianonavas.me @marianongdev
  • 2. What is a CVS for? • Allow team work together and collaborate • Have some kind of time machine in our code • Allow CI
  • 3. Approaches (architectural models) • Local • Rcs (Mac OS Developer Tools) • Centralized • Subversion • CVS • Perforce • Distributed • Git • Mercurial
  • 4. Approaches (architectural models) • Local • Rcs (Mac OS Developer Tools) • Centralized • Subversion • CVS • Perforce • Distributed • Git • Mercurial
  • 8. Centralized • Pros • Looks simple • We know it well; we've been using it for a long time • Good mainstream IDEs integration • It works  • Cons • We cannot commit offline (well, we can, but …) • We cannot integrate in our development toolset more than one repository • Dificult to collaborate if team is large (i.e. open source projects) • We are encouraged to avoid branches by the system.
  • 9. Distributed • Pros • Allow offline work • Easy collaboration model • Can link as many repositories as we might need • Almost every operation is local • Complete copy of the repository in each machine • Easy installation on server, and plenty of hosting services (free and paid) • Cons • More complex workflow (or not?) • Difficult to learn • ?????
  • 12. Branching in SVN Quotes taken from official svn website • "For projects that have a large number of contributors, it's common for most people to have working copies of the trunk. Whenever someone needs to make a long-running change that is likely to disrupt the trunk, a standard procedure is to create a private branch and commit changes there until all the work is complete" • "The bad news is that it's very easy to drift too far apart (...) it may be near-impossible to merge your changes back into the trunk without a huge number of conflicts" • "Subversion gives you the ability to selectively “copy” changes between branches. And when you're completely finished with your branch, your entire set of branch changes can be copied back into the trunk. In Subversion terminology, the general act of replicating changes from one branch to another is called merging, and it is performed using various invocations of the svn merge subcommand”
  • 13. Branching in SVN I (typical workflow) • Checkout from trunk. • Add a new file to working copy • Check status (svn st). • Track new file in svn (svn add). • Commit the new file (svn ci). • Modify the file, and check status again (svn st). • Commit the new change. • Modify again and let it remain modified.
  • 14. Branching in SVN II (branch & merge) • Svn copy at server level. • Check current working copy remote path (svn info). • Switch to new location (svn switch [remote] .) • Check remote again (svn info). • Commit some change to the branch. • Switch again to trunk. • Merge trunk with [myNewBranch] (svn merge [source@rev] .). Note that we do it with the working copy first to merge conflicts locally. • Commit to finish merge (we’ve done it locally in the previous step). • Again with a non-conflicting change in the same file. • Again with a conflicting change.
  • 15. Internal representation of data; svn • Repository: the main idea • Working copy • Revisions, which are deltas of a base state • The server has to workout deltas to resolve the concrete state of a revision (commit) • Each revision gets a unique (secuential) id. This is possible because it's centralized • Branches: are light copies of complete working trees • Summary: branch=copy.
  • 16. Drawbacks I: only one remote
  • 17. Drawbacks II: branch & merge sucks • Recall branch & merge procedure: • Copy trunk in branch directory in remote server • Checkout (or switch) locally. • Inspect revision we want to merge with, if not last. • Call svn merge. • Resolve conflicts (if any). • Commit the whole thing. • In practice we feel encouraged to not create branches (bad, bad, bad …).
  • 18. Drawback III: cleanliness • What if I want to merge my branch just to get up to date with our trunk, but I don’t want to make it public yet (incomplete feature or just playing around)?
  • 19. Drawback IV: privacy • Do I have to publish my code to a remote/public server to have version control? What if I’m doing some experiments I don’t want other people to see, or I just don’t want to mess up our central repository with something I don’t know if it’s going to work?
  • 21. Git – file status lifecycle
  • 22. Git internal storage structure: directed acyclic graph (DAG) • http://eagain.net/articles/git-for-computer-scientists/
  • 24. Deeper insight in git DAG internal structure
  • 25. Another view of git objects I
  • 26. Another view of git objects II
  • 27. Another view of git objects III
  • 28. Details on how git stores that in disk • http://git-scm.com/book/en/Git-Internals-Git-Objects
  • 30. More on git internal representation of data • http://eagain.net/articles/git-for-computer-scientists/ • http://en.wikipedia.org/wiki/Directed_acyclic_graph • Due to its distributed nature unique ids for commits are generated as SHA-1 digest to ensure unicity • Explanation • Snapshots, not deltas • Commits: blobs • Branches: references to commits • Repeat: branch = pointer • Current branch: HEAD pointer • Detached heads: careful
  • 31. SVN branch & merge summary • SVN has no branch concept. It's just another working copy with a common history • We can only merge two branches at a time • SVN allow you to merge even not at all related trees (error prone) • Refactor and moving things around; svn doesn't manage this kind of merges very well • Only allows interaction one repository at a time.
  • 32. Git branch & merge summary • It’s trivial to create a new branch from any point. • Git prevents us from deleting unmerged branches. • We can clean up obsolete branches keeping commits. • We can move a branch around (recreate it from any starting point). • We can merge more than one branch at a time (3 or even more!!!). • Git understands moved and renamed files. • This model encourage best practices: branch-per-feature, local branches for testing and experiments, git-flow …
  • 33. Git allow us to manage branching well
  • 35. Interesting git resource • http://git-scm.com • http://git-scm.com/docs/gittutorial • http://eagain.net/articles/git-for-computer-scientists/ • http://try.github.io/levels/1/challenges/1 • http://www.vogella.com/articles/Git/article.html • https://help.github.com/articles/ • http://gitimmersion.com
  • 36. Wich CVS should I choose and when?