Slide 1

Slide 1 text

Version Control Tips, tricks and good citizenship blog.tessbarnes.uk @crataegustess Tess Barnes :: October 2015

Slide 2

Slide 2 text

We see a lot of this… so we have to get used to this…

Slide 3

Slide 3 text

But these… lets be honest…

Slide 4

Slide 4 text

Really, really honest…

Slide 5

Slide 5 text

Why do we see so many? lots of developers lots of overlapping work context swapping impossible to talk all the time we are a bunch of (trainee) php scouts

Slide 6

Slide 6 text

So how do we fix them? Photo credit (CC BY 2.0) JD Hancock
 https://www.flickr.com/photos/jdhancock/8755184025

Slide 7

Slide 7 text

Practice bonsai cultivate a well shaped tree check out at the right level branch carefully clean up photo credit (CC BY-ND 2.0) Beverly Vealach 
 https://www.flickr.com/photos/cowtools/293244244

Slide 8

Slide 8 text

Be prepared Know the tools Keep a clean working copy - regular cleanup Avoid switching - run multiple working copies Watch where you leap - check commit logs first Communicate, collaborate - be a good citizen

Slide 9

Slide 9 text

Interleaving changes how it occurs: a file with an old method changed by dev a to new method changed by dev b to different new method dev a commits, dev b updates can’t add my block above their block as it would create interleaved lines

Slide 10

Slide 10 text

Interleaving changes - fixing how to fix: copy file.ext.mine to a new location accept in diff by ‘use {their} whole file’ & save copy in additional new method from .mine file

Slide 11

Slide 11 text

Tree conflicts • Watch where you leap! • announce big refactors • check what others have 
 committed in this area • collaborate to get early warning • _then_ consider merging

Slide 12

Slide 12 text

Tree conflict - add If you’re the second one in: 1. undo the add 2. move your file somewhere outside working copy 3. merge up to your branch / working copy & commit 4. manually copy changes in

Slide 13

Slide 13 text

Tree conflict - delete someone has deleted that nice file you fixed so beautifully… so find them and talk - it could be just a rename! renames can sometimes be solved by patch file massive refactors? talk, collaborate, hand copy feature removal? don't get frustrated, get coffee

Slide 14

Slide 14 text

Solve with tech (git) Switching context? 
 Stash your work in progress Separate coding standards changes? 
 Cherry pick your commits in ‘hunks’ Tree conflicts when adding files?
 No such thing? Tree conflicts against deleted files?
 Just choose to delete or re-add

Slide 15

Slide 15 text

photo credit (CC BY-SA 2.0) Sarabbit
 https://www.flickr.com/photos/sarabbit/4549185468

Slide 16

Slide 16 text

Interesting reads http://phpboyscout.uk/php-scout/ http://betterexplained.com/articles/a-visual-guide-to-version-control/ http://www.makebetterthings.com/tag/subversion/ http://tortoisesvn.net/docs/release/TortoiseSVN_en/index.html http://tortoisegit.org/docs/tortoisegit/ https://git-scm.com/downloads http://www.laliluna.de/articles/2012/06/15/when-subversion-fails.html