Version Control
at UCREL
or: How I learned to stop worrying and love git.
S. Wattam
and project management
Outline
Why is this stuff needed?
Why is this stuff important?
What’s new?
Why git?
How do I do use it?
Cake.
A case against local storage
Multiple collaborators
Research council policy (release)
Auditing
Remote access
Knowledge/resource islands
Gunfire
http://www.apartmenttherapy.com/cheaply-replacing-a-broken-mac-104523
A case against (drop)box.com
“Access without passwords was possible between 1:54pm PT and 5:46pm PT yesterday, the company said.”
“...our teams continue to work around-the-clock in hopes of discovering some way to recover this information. However, the likelihood of a successful outcome is extremely low.”
Edit collisions!
http://www.cnet.com/news/dropbox-confirms-security-glitch-no-password-required/
https://gigaom.com/2009/10/10/when-cloud-fails-t-mobile-microsoft-lose-sidekick-customer-data/
http://alexdanco.com/2014/10/15/theatres-of-the-absurd-how-to-get-startup-ideas/
Let’s codify all that version stuff
Identify files not just by filename, but:
Results in new, exciting workflows!
Version
Control
Systems
1970 - CA Software Change Manager
1980 - Endevor
1990 - Concurrent Versions System
2000 - SubVersioN
2005 - Bazaar
2005 - Mercurial
2005 - Git
VCS basics
Each change logged separately
Current file is the latest, ‘Head’ version
Multiple users: atomicity
+ Milk
Bread
+ Ham
- Ham
+ Rice
+ Bread
Bread
Milk
Rice
r4: Head
Bread
Milk
Ham
r3
Bread
Milk
r2
r1
VCS basics: branching
Branching creates parallel versions based on the same data
+ Milk
Bread
Bread
Milk
+ Ham
+ Bread
- Ham
+ Rice
Bread
Milk
Rice
r?: Head 1
Bread
Milk
Ham
r?
r2
r1
+ Jam
Bread
Jam
r?: Head 2
Bread
r?
- Milk
VCS basics: merging
Merging merges changes from one branch into another
+ Milk
Bread
Bread
Milk
+ Ham
+ Bread
- Ham
+ Rice
Bread
Milk
Rice
r?
Bread
Milk
Ham
r?
r2
r1
+ Jam
Bread
Jam
r?
Bread
r?
- Milk
± Changes
Bread
Milk
Rice
Jam
r?: Head
± Changes
SVN vs. Git:
Design
and
Differences
Issues in VCS design
How to store branches?
How to identify versions in branches?
How to merge?
How to prevent edit collisions?
How to store history?
Subversion
How to store branches?
How to identify versions in branches?
How to merge?
How to prevent edit collisions?
How to store history?
Stored in /branches: convention
Solved by the above
Copy files back; commit
Merge on commit; central server
Central server stores all history
Git
How to store branches?
How to identify versions in branches?
How to merge?
How to prevent edit collisions?
How to store history?
First-order concept
Non-sequential version IDs
Local merge; commit; push
Local merge on pull
Full local copy
Distributed vs. Centralised
http://programmers.stackexchange.com/a/35080
Workflow differences
Git
git clone git://url
git add file.xyz
git commit -m “Comment”
git push
(resolve conflicts)
Subversion
svn checkout svn://url
svn add file.xyz
svn commit -m “Comment”
(resolve conflicts)
Feature branches
http://stackoverflow.com/questions/27727698/closing-github-feature-branches-while-retaining-labels-in-network-graph
If they’re so similar, why is git so good?
Simpler branch/merge semantics
Local branching
Simpler patching/communication
Speed and space efficiency
Amazing project management tools
UCREL’s
Git
Infrastructure
Git tools promote project management
One repository per project:
Clients
Management tools at UCREL
Choosing a service
Github’s community is excellent, but:
Gitlab solves all of these
Demo
UCREL Github group
Gitlab:
Closing notes
History can be imported from Subversion
You’ll need a public/private key pair
Git can do way more than I cover here
https://stephenwattam.com/misc/files/git_cheatsheet.jpg
http://www.git-tower.com/blog/git-for-subversion-users-cheat-sheet/
http://tinyurl.com/obfrq5d
Questions
Where is the cake?