Skip to content

Instantly share code, notes, and snippets.

@uniquelau
Last active December 14, 2015 23:59
Show Gist options
  • Save uniquelau/5169848 to your computer and use it in GitHub Desktop.
Save uniquelau/5169848 to your computer and use it in GitHub Desktop.
Version Control 101

Version Control

Concept

Version Control does what it says on the tin. It allows you to travel back in time. As with most computer software it comes in different flavours (SVN, Hg, Git, etc) but the core concepts remain the same. A person creates or edits a file and these changes are 'commited' against time. Everytime a commit happens, a marker is created - a snapshot. This contains some meta data/information:

[timeline diagram]

  1. Who
  2. What
  3. Why

Who = 'Jermery from Accounts'

This is the current user, the one that is 'logged' in currently.

What (list of files)

  • /index.html
  • /css/layout.css
  • /media/accounts.excel

Each time a commit is made, the user selects which files should be contained in that commit. The user confirms which files make up the commit.

Why = 'updated webpage to contain link to new accounts document'

A description of why the changes were made. E.g. '#header bug fixes for IE7' or 'added customer x to accounts'

These commits can then be 'pushed' (up) to a central location, so other people can access the latest changes. (computer breaks, hard drive fails, no worries!)

Who is it for

Everybody

Why?

Benefits

  • Collaboration becomes easy.
  • Provides security and makes disater recovery easier.
  • One small step towards working in a more 'agile' way -> e.g. Incremental Development, quick prototyping, quick delivery.
  • Combined with a difference tool, and you can see easily what's changed

Text Difference

Graphics Difference

Technology

Flavours of VCS - Version Control Software

  • SVN -> it's been around for ages.
  • Hg -> suited to .NET development, Apple support improving greatly.
  • Git -> Popular in the Open Source world,

Hg and Git -> very similar, same concepts, free.

Centralised or Distributed

Centralised -> requires a server -> think Master Control in Tron -> everything goes THROUGH this point

Centralised VCS

Distrubuted -> server optional -> each user gets a copy of everything -> very robust - each user get's there own local repository - changes are 'COMMITED' here - and then PUSHed up to the Central Repository - Server breaks, everyone can still work.

Distrubuted

Benefits of Distrubuted

  • Works when person is offline, unlimited changes/COMMITS can be 'PUSHED' up when they are back online
  • Removes single point of failure
  • Faster, each communication isn't going through 'Master Control' e.g. the server

Disadvantages of Distrubuted

  • The first time the data (Repository) is got, every changeset is sent. E.g. everything in the history is sent. If the repository is full of media (e.g. 24 versions of 24 12Mb Photoshop files) then this initial download is slow.

Cost

There are paid for VCS solutions and free ones. The main cost with any system is storing the data and fixing it when something goes wrong (understanding = time).

It is possible & easy (1 day) to host your own VCS system on internal servers. However the cost of using an external solution is so low, it's likely to be lower than the cost of the IT department setting up and running a VCS server.

E.g.

Bitbucket -> $1 per User per Month. e.g. 1 year with 25 years =

Getting started / ??Demo??

  1. Create a local repository and start using source control.

Getting started with HG

  1. Download and install TortoiseHg and archive the same things through a windows GUI

Acrynomns

  • VCS = Version Control Software
  • Hg = Mercurial
  • SVN = Subversion
  • Git = Git
  • DRCS = Distributed Revision Control Software

Further reading

Bite Sized Mercurial Introduction HGinit Joel on DVCS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment