version control - scale · 2016-06-19 · version control systems for your code. if your mental...

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

Upload: others

Post on 27-May-2020

5 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: version control - SCALE · 2016-06-19 · version control systems for your code. If your mental health has been compromised by index.version080912f-b.inc file naming, or you wish

version controlfor mere and freelance mortals

emma jane [email protected]

Page 2: version control - SCALE · 2016-06-19 · version control systems for your code. If your mental health has been compromised by index.version080912f-b.inc file naming, or you wish

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 - SCALE · 2016-06-19 · version control systems for your code. If your mental health has been compromised by index.version080912f-b.inc file naming, or you wish

By the end you will be equipped to use version control

as part of your daily routine.

Page 4: version control - SCALE · 2016-06-19 · version control systems for your code. If your mental health has been compromised by index.version080912f-b.inc file naming, or you wish

SRSLY

Page 5: version control - SCALE · 2016-06-19 · version control systems for your code. If your mental health has been compromised by index.version080912f-b.inc file naming, or you wish

Why this talk?

Page 6: version control - SCALE · 2016-06-19 · version control systems for your code. If your mental health has been compromised by index.version080912f-b.inc file naming, or you wish

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

Page 7: version control - SCALE · 2016-06-19 · version control systems for your code. If your mental health has been compromised by index.version080912f-b.inc file naming, or you wish

And this is awesome:$ bzr blame legalnotice.xml 156.1.13 camille | <?xml version="1.0" encoding="utf­8"?>156.1.19 camille | <!DOCTYPE legalnotice PUBLIC "­//OASIS//DTD DocBook XML 

V4.3//EN" "http://docbook.org/xml/4.3/docbookx.dtd">156.1.5  spindle | <legalnotice>156.1.13 camille |   <para>Written by and attributed to Canonical Ltd. 

and the Ubuntu161.1.2  emmajan |   Training community 2008­2009.</para>156.1.13 camille |   <para>This license is bound by the Creative Commons: CC by

Page 8: version control - SCALE · 2016-06-19 · version control systems for your code. If your mental health has been compromised by index.version080912f-b.inc file naming, or you wish

A brief history of version control...

Page 9: version control - SCALE · 2016-06-19 · version control systems for your code. If your mental health has been compromised by index.version080912f-b.inc file naming, or you wish

Ancient:  SCCS (1972)

Old School:  RCS (ci / co)

Centralized:  CVS / Subversion

Decentralized:  Git / Mercurial / Bazaar / SVK

Page 10: version control - SCALE · 2016-06-19 · version control systems for your code. If your mental health has been compromised by index.version080912f-b.inc file naming, or you wish
Page 11: version control - SCALE · 2016-06-19 · version control systems for your code. If your mental health has been compromised by index.version080912f-b.inc file naming, or you wish
Page 12: version control - SCALE · 2016-06-19 · version control systems for your code. If your mental health has been compromised by index.version080912f-b.inc file naming, or you wish
Page 13: version control - SCALE · 2016-06-19 · version control systems for your code. If your mental health has been compromised by index.version080912f-b.inc file naming, or you wish
Page 14: version control - SCALE · 2016-06-19 · version control systems for your code. If your mental health has been compromised by index.version080912f-b.inc file naming, or you wish

A real history of VC is available from:

http://en.wikipedia.org/wiki/Version_control

Page 15: version control - SCALE · 2016-06-19 · version control systems for your code. If your mental health has been compromised by index.version080912f-b.inc file naming, or you wish

Bazaar&

Launchpad

Page 16: version control - SCALE · 2016-06-19 · version control systems for your code. If your mental health has been compromised by index.version080912f-b.inc file naming, or you wish

Open sourcedOpen sourcedJuly 2009July 2009

Page 17: version control - SCALE · 2016-06-19 · version control systems for your code. If your mental health has been compromised by index.version080912f-b.inc file naming, or you wish

Workflow

Page 18: version control - SCALE · 2016-06-19 · version control systems for your code. If your mental health has been compromised by index.version080912f-b.inc file naming, or you wish

Drupal – Freelance Contracts

Page 19: version control - SCALE · 2016-06-19 · version control systems for your code. If your mental health has been compromised by index.version080912f-b.inc file naming, or you wish

Ubuntu Documentation Team

Page 20: version control - SCALE · 2016-06-19 · version control systems for your code. If your mental health has been compromised by index.version080912f-b.inc file naming, or you wish

Drupal – Freelance Contracts

Page 21: version control - SCALE · 2016-06-19 · version control systems for your code. If your mental health has been compromised by index.version080912f-b.inc file naming, or you wish

my setup

Local testing server

backups

Live server

Page 22: version control - SCALE · 2016-06-19 · version control systems for your code. If your mental health has been compromised by index.version080912f-b.inc file naming, or you wish

my files

client

graphics

themes

documentation

Page 23: version control - SCALE · 2016-06-19 · version control systems for your code. If your mental health has been compromised by index.version080912f-b.inc file naming, or you wish

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

you only need this on machines that will be editing code

1

Page 24: version control - SCALE · 2016-06-19 · version control systems for your code. If your mental health has been compromised by index.version080912f-b.inc file naming, or you wish

Start the magic trick$ bzr init

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

2

Page 25: version control - SCALE · 2016-06-19 · version control systems for your code. If your mental health has been compromised by index.version080912f-b.inc file naming, or you wish

Put the rabbit into the hat$ bzr add

Add your files to the version control system.

3

Page 26: version control - SCALE · 2016-06-19 · version control systems for your code. If your mental health has been compromised by index.version080912f-b.inc file naming, or you wish

4Wave the magic wand

$ bzr commitCommit the “changes” to the repository.

Page 27: version control - SCALE · 2016-06-19 · version control systems for your code. If your mental health has been compromised by index.version080912f-b.inc file naming, or you wish

Do some work.commit again

Page 28: version control - SCALE · 2016-06-19 · version control systems for your code. If your mental health has been compromised by index.version080912f-b.inc file naming, or you wish

5The rabbit appears on the server

$ bzr uploadUpload the changes via SFTP to the Web server.

Page 29: version control - SCALE · 2016-06-19 · version control systems for your code. If your mental health has been compromised by index.version080912f-b.inc file naming, or you wish

More information at:http://bazaar­vcs.org/BazaarUploadForWebDev

Page 30: version control - SCALE · 2016-06-19 · version control systems for your code. If your mental health has been compromised by index.version080912f-b.inc file naming, or you wish

Ubuntu Documentation Team

Page 31: version control - SCALE · 2016-06-19 · version control systems for your code. If your mental health has been compromised by index.version080912f-b.inc file naming, or you wish

Working efficientlyThe local project

trunk idea1 idea2

Page 32: version control - SCALE · 2016-06-19 · version control systems for your code. If your mental health has been compromised by index.version080912f-b.inc file naming, or you wish

Working efficiently$ bzr init­repo project­name

The local project

trunk idea1 idea2

1

Page 33: version control - SCALE · 2016-06-19 · version control systems for your code. If your mental health has been compromised by index.version080912f-b.inc file naming, or you wish

2Download the files

$ bzr branch lp:project­name trunkFrom launchpad.

The local project

trunk idea1 idea2

Page 34: version control - SCALE · 2016-06-19 · version control systems for your code. If your mental health has been compromised by index.version080912f-b.inc file naming, or you wish

3Copy the files to a working tree

$ bzr branch trunk idea1$ bzr branch trunk idea2

The local project

trunk idea1 idea2

Page 35: version control - SCALE · 2016-06-19 · version control systems for your code. If your mental health has been compromised by index.version080912f-b.inc file naming, or you wish

Do some work.

Page 36: version control - SCALE · 2016-06-19 · version control systems for your code. If your mental health has been compromised by index.version080912f-b.inc file naming, or you wish

4Wave the magic wand, again

$ bzr commitCommit the “changes” to the working tree—same as before.

The local project

trunk idea1 idea2

Page 37: version control - SCALE · 2016-06-19 · version control systems for your code. If your mental health has been compromised by index.version080912f-b.inc file naming, or you wish

Collaboration is like a bad1980s dance trax...

Page 38: version control - SCALE · 2016-06-19 · version control systems for your code. If your mental health has been compromised by index.version080912f-b.inc file naming, or you wish

Photo source: wikipedia

Page 39: version control - SCALE · 2016-06-19 · version control systems for your code. If your mental health has been compromised by index.version080912f-b.inc file naming, or you wish

5Work with other people

$ bzr pushPushes your changes to an off­site repository.

You will need to include a location the first time you push.$ bzr push lp:~USER_NAME/your­project­name/my­branchname

The local project

trunk idea1 idea2

Page 40: version control - SCALE · 2016-06-19 · version control systems for your code. If your mental health has been compromised by index.version080912f-b.inc file naming, or you wish

6Incorporate changes from others:

$ bzr merge$ bzr pull

Page 41: version control - SCALE · 2016-06-19 · version control systems for your code. If your mental health has been compromised by index.version080912f-b.inc file naming, or you wish

Quick reference$ bzr ­­help commands

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

Page 42: version control - SCALE · 2016-06-19 · version control systems for your code. If your mental health has been compromised by index.version080912f-b.inc file naming, or you wish

But what But what about you?about you?

[email protected]@hicktech.comwww.emmajane.netwww.emmajane.net