A brief introduction to version control systems
-
Upload
tim-staley -
Category
Software
-
view
229 -
download
2
description
Transcript of A brief introduction to version control systems
![Page 1: A brief introduction to version control systems](https://reader034.fdocuments.in/reader034/viewer/2022042607/559b83d41a28ab29458b465f/html5/thumbnails/1.jpg)
A brief introduction toversion control systems
Tim Staley
Astronomy Group Monday SeminarSouthampton, November 2013
WWW: timstaley.co.uk
![Page 2: A brief introduction to version control systems](https://reader034.fdocuments.in/reader034/viewer/2022042607/559b83d41a28ab29458b465f/html5/thumbnails/2.jpg)
The problem No backup Manual copies Centralised VCS Distributed VCS
Aims
É Help identify problem that can besolved.
É Introduce basic concepts of versioncontrol.
É Explain why various technologiesexist, and which you should choose.
![Page 3: A brief introduction to version control systems](https://reader034.fdocuments.in/reader034/viewer/2022042607/559b83d41a28ab29458b465f/html5/thumbnails/3.jpg)
The problem No backup Manual copies Centralised VCS Distributed VCS
![Page 4: A brief introduction to version control systems](https://reader034.fdocuments.in/reader034/viewer/2022042607/559b83d41a28ab29458b465f/html5/thumbnails/4.jpg)
The problem No backup Manual copies Centralised VCS Distributed VCS
When you need versioncontrol
É Complex documents, built up overtime.
É Multiple collaborators (or even justmultiple machines).
É Multiple versions which ‘co-evolve.’
É Reproducibility (‘snapshots’).
![Page 5: A brief introduction to version control systems](https://reader034.fdocuments.in/reader034/viewer/2022042607/559b83d41a28ab29458b465f/html5/thumbnails/5.jpg)
The problem No backup Manual copies Centralised VCS Distributed VCS
Four Evolutionary Stages
![Page 6: A brief introduction to version control systems](https://reader034.fdocuments.in/reader034/viewer/2022042607/559b83d41a28ab29458b465f/html5/thumbnails/6.jpg)
The problem No backup Manual copies Centralised VCS Distributed VCS
Stage 0: Not backing up
DON’T DO THIS
![Page 7: A brief introduction to version control systems](https://reader034.fdocuments.in/reader034/viewer/2022042607/559b83d41a28ab29458b465f/html5/thumbnails/7.jpg)
The problem No backup Manual copies Centralised VCS Distributed VCS
Stage 0: Not backing up
DON’T DO THIS
![Page 8: A brief introduction to version control systems](https://reader034.fdocuments.in/reader034/viewer/2022042607/559b83d41a28ab29458b465f/html5/thumbnails/8.jpg)
The problem No backup Manual copies Centralised VCS Distributed VCS
Stage 1: Manual copies
![Page 9: A brief introduction to version control systems](https://reader034.fdocuments.in/reader034/viewer/2022042607/559b83d41a28ab29458b465f/html5/thumbnails/9.jpg)
The problem No backup Manual copies Centralised VCS Distributed VCS
Stage 1: Manual copies
Flaws:É Manual = fallible.
É Backup: Copies of copies.
É Labelling.
We need metadata - datestamps,annotations, attribution.And tools - make this stuff quick andeasy!
![Page 10: A brief introduction to version control systems](https://reader034.fdocuments.in/reader034/viewer/2022042607/559b83d41a28ab29458b465f/html5/thumbnails/10.jpg)
The problem No backup Manual copies Centralised VCS Distributed VCS
Stage 1: Manual copies
Flaws:É Manual = fallible.
É Backup: Copies of copies.
É Labelling.We need metadata - datestamps,annotations, attribution.And tools - make this stuff quick andeasy!
![Page 11: A brief introduction to version control systems](https://reader034.fdocuments.in/reader034/viewer/2022042607/559b83d41a28ab29458b465f/html5/thumbnails/11.jpg)
The problem No backup Manual copies Centralised VCS Distributed VCS
Aside: ‘Cloudy’ technologies
Trade off — convenience vs control.Good for:É Small docs, frequently updated across
multiple locations (e.g. to-do list).É Basic backups of items unlikely to
evolve (photos, etc).
![Page 12: A brief introduction to version control systems](https://reader034.fdocuments.in/reader034/viewer/2022042607/559b83d41a28ab29458b465f/html5/thumbnails/12.jpg)
The problem No backup Manual copies Centralised VCS Distributed VCS
Aside: ‘Cloudy’ technologies
Problems:É Versioning is all automated - can’t
choose sensible ‘checkpoints’ to markout.
É Collaboration is still broken, unlessyou’re working on very simple docs.
NEED MORE METADATA
![Page 13: A brief introduction to version control systems](https://reader034.fdocuments.in/reader034/viewer/2022042607/559b83d41a28ab29458b465f/html5/thumbnails/13.jpg)
The problem No backup Manual copies Centralised VCS Distributed VCS
Aside: ‘Cloudy’ technologies
Problems:É Versioning is all automated - can’t
choose sensible ‘checkpoints’ to markout.
É Collaboration is still broken, unlessyou’re working on very simple docs.
NEED MORE METADATA
![Page 14: A brief introduction to version control systems](https://reader034.fdocuments.in/reader034/viewer/2022042607/559b83d41a28ab29458b465f/html5/thumbnails/14.jpg)
The problem No backup Manual copies Centralised VCS Distributed VCS
Stage Two
![Page 15: A brief introduction to version control systems](https://reader034.fdocuments.in/reader034/viewer/2022042607/559b83d41a28ab29458b465f/html5/thumbnails/15.jpg)
The problem No backup Manual copies Centralised VCS Distributed VCS
Centralised version control
e.g.É ‘Concurrent Versions System’ (CVS,
now defunct).É ‘Subversion’ (SVN).
![Page 16: A brief introduction to version control systems](https://reader034.fdocuments.in/reader034/viewer/2022042607/559b83d41a28ab29458b465f/html5/thumbnails/16.jpg)
The problem No backup Manual copies Centralised VCS Distributed VCS
Basic concepts, 1
Record an annotated history of changesets.
É Trunk, branchÉ Parents, ancestors
![Page 17: A brief introduction to version control systems](https://reader034.fdocuments.in/reader034/viewer/2022042607/559b83d41a28ab29458b465f/html5/thumbnails/17.jpg)
The problem No backup Manual copies Centralised VCS Distributed VCS
Basic concepts, 2Centralized⇔Master copy
É RepositoryÉ CheckoutÉ Commit / Revision
![Page 18: A brief introduction to version control systems](https://reader034.fdocuments.in/reader034/viewer/2022042607/559b83d41a28ab29458b465f/html5/thumbnails/18.jpg)
The problem No backup Manual copies Centralised VCS Distributed VCS
Basic concepts, 3
MergingIn simple cases, merges are automatic!Tree-records allows us to build the newcombined version.
![Page 19: A brief introduction to version control systems](https://reader034.fdocuments.in/reader034/viewer/2022042607/559b83d41a28ab29458b465f/html5/thumbnails/19.jpg)
The problem No backup Manual copies Centralised VCS Distributed VCS
Basic concepts, 3Manual merging: When conflicts exist,we have the info and tools to manuallyresolve them.
![Page 20: A brief introduction to version control systems](https://reader034.fdocuments.in/reader034/viewer/2022042607/559b83d41a28ab29458b465f/html5/thumbnails/20.jpg)
The problem No backup Manual copies Centralised VCS Distributed VCS
Distributed VCS
1986 – early 2000’s: Why would youmake this any more complex? This works.
INTERWEBS(See e.g. visualised history of Python,https://www.youtube.com/watch?v=cNBtDstOTmA)
![Page 21: A brief introduction to version control systems](https://reader034.fdocuments.in/reader034/viewer/2022042607/559b83d41a28ab29458b465f/html5/thumbnails/21.jpg)
The problem No backup Manual copies Centralised VCS Distributed VCS
Distributed VCS
1986 – early 2000’s: Why would youmake this any more complex? This works.
INTERWEBS
(See e.g. visualised history of Python,https://www.youtube.com/watch?v=cNBtDstOTmA)
![Page 22: A brief introduction to version control systems](https://reader034.fdocuments.in/reader034/viewer/2022042607/559b83d41a28ab29458b465f/html5/thumbnails/22.jpg)
The problem No backup Manual copies Centralised VCS Distributed VCS
Distributed VCS
1986 – early 2000’s: Why would youmake this any more complex? This works.
INTERWEBS(See e.g. visualised history of Python,https://www.youtube.com/watch?v=cNBtDstOTmA)
![Page 23: A brief introduction to version control systems](https://reader034.fdocuments.in/reader034/viewer/2022042607/559b83d41a28ab29458b465f/html5/thumbnails/23.jpg)
The problem No backup Manual copies Centralised VCS Distributed VCS
Centralised doesn’t scale
É Many collaborators.É Cannot check-in half-finished work to
master.É Cannot keep track of a branch for
every collaborator.
É Resort back to hybrid of central copyunder version control, with manylocal, manual backups forintermediate work.
![Page 24: A brief introduction to version control systems](https://reader034.fdocuments.in/reader034/viewer/2022042607/559b83d41a28ab29458b465f/html5/thumbnails/24.jpg)
The problem No backup Manual copies Centralised VCS Distributed VCS
Centralised doesn’t scale
É Many collaborators.É Cannot check-in half-finished work to
master.É Cannot keep track of a branch for
every collaborator.É Resort back to hybrid of central copy
under version control, with manylocal, manual backups forintermediate work.
![Page 25: A brief introduction to version control systems](https://reader034.fdocuments.in/reader034/viewer/2022042607/559b83d41a28ab29458b465f/html5/thumbnails/25.jpg)
The problem No backup Manual copies Centralised VCS Distributed VCS
The distributed modelStage 3: Distribute!
É Everyone has their own mirror, orclone of the repository.
É Changes are distributed via pushesand pulls.
![Page 26: A brief introduction to version control systems](https://reader034.fdocuments.in/reader034/viewer/2022042607/559b83d41a28ab29458b465f/html5/thumbnails/26.jpg)
The problem No backup Manual copies Centralised VCS Distributed VCS
Distribute!
Benefits for you:É More flexible. Allows different
workflows and collaborative behaviouretc.
É Can commit offline, sync later.
É Talk to me later if you want the details.
![Page 27: A brief introduction to version control systems](https://reader034.fdocuments.in/reader034/viewer/2022042607/559b83d41a28ab29458b465f/html5/thumbnails/27.jpg)
The problem No backup Manual copies Centralised VCS Distributed VCS
So which should I use?
At this stage, git and mercurial arefunctionally equivalent — but git has wonthe majority mindshare, therefore: bettersupport, better chance of collaboratorsusing same system, etc.
![Page 28: A brief introduction to version control systems](https://reader034.fdocuments.in/reader034/viewer/2022042607/559b83d41a28ab29458b465f/html5/thumbnails/28.jpg)
The problem No backup Manual copies Centralised VCS Distributed VCS
So which should I use?
At this stage, git and mercurial arefunctionally equivalent — but git has wonthe majority mindshare, therefore: bettersupport, better chance of collaboratorsusing same system, etc.
![Page 29: A brief introduction to version control systems](https://reader034.fdocuments.in/reader034/viewer/2022042607/559b83d41a28ab29458b465f/html5/thumbnails/29.jpg)
The problem No backup Manual copies Centralised VCS Distributed VCS
Summary
É Version control helps with:É BackupsÉ ReproducibilityÉ Comparing arbitrary historical versions.É Maintaining multiple live versions.
É Lots of free services and materialonline to help you out.
É Bit of a learning curve at first - butpayoff is large in long-run. (And nowyou have a headstart!)
![Page 30: A brief introduction to version control systems](https://reader034.fdocuments.in/reader034/viewer/2022042607/559b83d41a28ab29458b465f/html5/thumbnails/30.jpg)
The problem No backup Manual copies Centralised VCS Distributed VCS
Advanced Reading
To start, google ‘git intro’, etc. Then. . .É Git for Computer Scientistshttp://eagain.net/articles/git-for-computer-scientists/
É Understanding Git Conceptuallyhttp://www.sbf5.com/~cduan/technical/git/
É Understanding the Git Workflowhttps://sandofsky.com/blog/git-workflow.html