Version Control for mere and freelance mortals

31
version control for mere and freelance mortals emma jane hogbin [email protected] www.emmajane.net

description

Presented at Ontario Linux Fest, 2008. www.onlinux.ca As a freelance developer chances are good you use either many, or no, version control systems for your code. If your mental health has been compromised by index.version080912f-b.inc file naming, or you wish there was more flexibility in how (and when) your files are submitted to data central, it\'s possible that Bazaar is the version control system you\'ve been waiting for. In this session you will be exposed to one freelancer\'s adventures of getting all projects arranged into a manageable version control system. Specific topics will include: * an overview of the main competitors in the open source world of version control (the good, the better and the CVS); * a peek into a single human\'s work environment to see how it ties together multiple projects, multiple computers, and deals with travel-related network outages; and finally, * a tour of the basics you will need to set up your own system with Bazaar.

Transcript of Version Control for mere and freelance mortals

Page 1: Version Control for mere and freelance mortals

version controlfor mere and freelance mortals

emma jane [email protected]

Page 2: Version Control for mere and freelance mortals

About this talk● As a freelance developer chances are good you use either many, or no,

version control systems for your code. If your mental health has been compromised by index.version080912f-b.inc file naming, or you wish there was more flexibility in how (and when) your files are submitted to data central, it's possible that Bazaar is the version control system you've been waiting for.

● In this session you will be exposed to one freelancer's adventures of getting all projects arranged into a manageable version control system. Specific topics will include:

● * an overview of the main competitors in the open source world of version control (the good, the better and the CVS);

● * a peek into a single human's work environment to see how it ties together multiple projects, multiple computers, and deals with travel-related network outages; and finally,

● * a tour of the basics you will need to set up your own system with Bazaar.

Page 3: Version Control for mere and freelance mortals

This talk is ten slides long.

Page 4: Version Control for mere and freelance mortals

By the end you will be equipped to use version control

as part of your daily routine.

Page 5: Version Control for mere and freelance mortals

Only one of those statementswas a lie.

Page 6: Version Control for mere and freelance mortals

SRSLY

Page 7: Version Control for mere and freelance mortals

Why this talk?

Page 8: Version Control for mere and freelance mortals

Because this sucks:$ cp template.php template.php.old$ vim template.php$ cp template.php template.php.c.20081025c

Page 9: Version Control for mere and freelance mortals

And this is awesome:$ bzr tagsend_v1_design        12v1_layout            5v2_font_changes      7

Page 10: Version Control for mere and freelance mortals

A brief history of version control...

Page 11: Version Control for mere and freelance mortals

Ancient:  SCCS (1972)

Old School:  RCS (ci / co)

Centralized:  CVS / Subversion

Decentralized:  Git / Mercurial / Bazaar / SVK

Page 12: Version Control for mere and freelance mortals

Actually, I stole that slide from a really awesome geek.

Page 13: Version Control for mere and freelance mortals
Page 14: Version Control for mere and freelance mortals
Page 15: Version Control for mere and freelance mortals
Page 16: Version Control for mere and freelance mortals
Page 17: Version Control for mere and freelance mortals

A real history of VC is available from:

www.wikipedia.org

Page 18: Version Control for mere and freelance mortals

my setup

Local testing server

backups

Live server

Page 19: Version Control for mere and freelance mortals

my files

client

graphics

themes

documentation

Page 20: Version Control for mere and freelance mortals

Install Bazaarhttp://bazaar­vcs.org/Download

you only need this on machines that will be editing code

1

Page 21: Version Control for mere and freelance mortals

Start the magic trick$ bzr init

this converts the directory to one that can be version­controlled

2

Page 22: Version Control for mere and freelance mortals

Put the rabbit into the hat$ bzr add

Add your files to the version control system.

3

Page 23: Version Control for mere and freelance mortals

4Wave the magic wand

$ bzr commitCommit the “changes” to the repository.

Page 24: Version Control for mere and freelance mortals

5Wave the wand faster

$ bzr commit ­m “adding files”Add the commit message from the command line.

Page 25: Version Control for mere and freelance mortals

6Do useful things:

$ bzr mv$ bzr remove

$ bzr uncommit$ bzr revert ­r # filename

Page 26: Version Control for mere and freelance mortals

7Tag your code milestones

$ bzr tag your_tag_nameAdds the tag to the previously committed changes.

Page 27: Version Control for mere and freelance mortals

View tags (alpha sort):$ bzr tagsend_v1_design        12v1_layout            5v2_font_changes      7

View tags (date sort):$ bzr tags ­datev1_layout            5v2_font_changes      7end_v1_design        12

Page 28: Version Control for mere and freelance mortals

8Work with other people

$ bzr pushPushes your changes to a repository somewhere else. You will need to configure 

this a little bit. Read more at: http://doc.bazaar­vcs.org/bzr.dev/en/user­guide/index.html#team­collaboration­central­style

Page 29: Version Control for mere and freelance mortals

9Get fun plugins

http://bazaar­vcs.org/BzrPluginsI use bzr_push_and_update.

Page 30: Version Control for mere and freelance mortals

10Quick reference

$ bzr ­­help commands

Talk to helpful people/join #bzr (on irc.freenode.net)

Page 31: Version Control for mere and freelance mortals

Thank you!Thank [email protected]@hicktech.com

www.hicktech.comwww.hicktech.com