1 of 25

Version Control

at UCREL

or: How I learned to stop worrying and love git.

​

​

​

S. Wattam

and project management

2 of 25

Outline

Why is this stuff needed?

Why is this stuff important?

What’s new?

Why git?

How do I do use it?

​

Cake.

3 of 25

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

4 of 25

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/

5 of 25

Let’s codify all that version stuff

Identify files not just by filename, but:

  • Filename
  • Time
  • Branch

​

Results in new, exciting workflows!

6 of 25

Version

Control

Systems

1970 - CA Software Change Manager

1980 - Endevor

1990 - Concurrent Versions System

2000 - SubVersioN

2005 - Bazaar

2005 - Mercurial

2005 - Git

7 of 25

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

8 of 25

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

9 of 25

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

10 of 25

SVN vs. Git:

​

Design

and

Differences

11 of 25

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?

12 of 25

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

13 of 25

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

14 of 25

Distributed vs. Centralised

http://programmers.stackexchange.com/a/35080

15 of 25

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)

​

16 of 25

Feature branches

http://stackoverflow.com/questions/27727698/closing-github-feature-branches-while-retaining-labels-in-network-graph

17 of 25

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

18 of 25

UCREL’s

Git

Infrastructure

19 of 25

Git tools promote project management

One repository per project:

  • Issue tracking
  • Team management
  • Versioning/merging
  • Documentation
  • Integrations

​

20 of 25

Clients

21 of 25

Management tools at UCREL

22 of 25

Choosing a service

Github’s community is excellent, but:

  • No control over data
  • OSS licensing only
  • No storing research data
  • Limited team tools

​

Gitlab solves all of these

​

23 of 25

Demo

UCREL Github group

Gitlab:

  • Basic git operations
  • Branching and Merging
  • Forking and merge requests
  • Issue tracking
  • Documentation wiki
  • Team management

24 of 25

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

25 of 25

Questions

Where is the cake?