Slide 1

Slide 1 text

Improve Your Development Process with Git @lachlanhardy

Slide 2

Slide 2 text

Who am I? ✦ Lachlan Hardy

Slide 3

Slide 3 text

Who am I? ✦ Lachlan Hardy ✦ I lead development at Ninefold

Slide 4

Slide 4 text

Who am I? ✦ Lachlan Hardy ✦ I lead development at Ninefold ✦ I’ve lead teams at News Digital Media, Atlassian and BigPond IPTV

Slide 5

Slide 5 text

Who am I? ✦ Lachlan Hardy ✦ I lead development at Ninefold ✦ I’ve lead teams at News Digital Media, Atlassian and BigPond IPTV ✦ I like Ruby, JavaScript and making awesome web stuff.

Slide 6

Slide 6 text

What is Git? ✦ Open source

Slide 7

Slide 7 text

What is Git? ✦ Open source ✦ Distributed version control system

Slide 8

Slide 8 text

What is Git? ✦ Open source ✦ Distributed version control system ✦ Designed for speed and efficiency

Slide 9

Slide 9 text

What is Git?

Slide 10

Slide 10 text

What is Git? ✦ local copy is a full copy Distributed

Slide 11

Slide 11 text

What is Git? ✦ local copy is a full copy ✦ local copy is a backup Distributed

Slide 12

Slide 12 text

What is Git? ✦ local copy is a full copy ✦ local copy is a backup ✦ commit to local copy Distributed

Slide 13

Slide 13 text

What is Git? ✦ local copy is a full copy ✦ local copy is a backup ✦ commit to local copy ✦ work offline Distributed

Slide 14

Slide 14 text

What is Git? ✦ perform diffs Work Offline

Slide 15

Slide 15 text

What is Git? ✦ perform diffs ✦ commit changes Work Offline

Slide 16

Slide 16 text

What is Git? ✦ perform diffs ✦ commit changes ✦ switch branches Work Offline

Slide 17

Slide 17 text

What is Git? ✦ perform diffs ✦ commit changes ✦ switch branches ✦ merge branches Work Offline

Slide 18

Slide 18 text

What is Git? ✦ Snapshots, not deltas Speed and Efficiency

Slide 19

Slide 19 text

What is Git? ✦ Snapshots, not deltas ✦ Commit-based logic Speed and Efficiency

Slide 20

Slide 20 text

What is Git? ✦ Snapshots, not deltas ✦ Commit-based logic ✦ Each commit has access to full history Speed and Efficiency

Slide 21

Slide 21 text

Setting up a repository $ git config --global user.name “Lachlan Hardy” $ git config --global user.email “[email protected]” Configuration

Slide 22

Slide 22 text

Setting up a repository $ cd example/ $ git init master $ touch README master $ git add . master $ git commit -m “This is my first commit.” Create

Slide 23

Slide 23 text

Setting up a repository $ git clone git://example.com/repository/ example.git $ cd example/ Clone

Slide 24

Slide 24 text

Developer Workflow ✦ Topic Branching

Slide 25

Slide 25 text

Developer Workflow ✦ Topic Branching ✦ Commit work locally

Slide 26

Slide 26 text

Developer Workflow ✦ Topic Branching ✦ Commit work locally ✦ Update local copy

Slide 27

Slide 27 text

Developer Workflow ✦ Topic Branching ✦ Commit work locally ✦ Update local copy ✦ Merge work to trunk and push to server

Slide 28

Slide 28 text

Developer Workflow master $ git pull origin master Topic Branching

Slide 29

Slide 29 text

Developer Workflow master $ git pull origin master master $ git checkout -b new-feature Topic Branching

Slide 30

Slide 30 text

Developer Workflow master $ git pull origin master master $ git checkout -b new-feature new-feature $ ...do some stuff... Topic Branching

Slide 31

Slide 31 text

Developer Workflow new-feature $ git status Commit Work Locally

Slide 32

Slide 32 text

Developer Workflow new-feature $ git status new-feature $ git add changed-file.txt Commit Work Locally

Slide 33

Slide 33 text

Developer Workflow new-feature $ git status new-feature $ git add changed-file.txt new-feature $ git commit -a “I changed a file” Commit Work Locally

Slide 34

Slide 34 text

Developer Workflow new-feature $ git checkout master Update Local Copy

Slide 35

Slide 35 text

Developer Workflow new-feature $ git checkout master master $ git pull origin master Update Local Copy

Slide 36

Slide 36 text

Developer Workflow master $ git merge new-feature Merge Work to Trunk and Push to Server

Slide 37

Slide 37 text

Developer Workflow master $ git merge new-feature master $ git push origin master Merge Work to Trunk and Push to Server

Slide 38

Slide 38 text

Working in a team ✦ Work locally

Slide 39

Slide 39 text

Working in a team ✦ Work locally ✦ Share work without a server

Slide 40

Slide 40 text

Working in a team ✦ Work locally ✦ Share work without a server ✦ Test code locally in isolation

Slide 41

Slide 41 text

Working in a team ✦ Work locally ✦ Share work without a server ✦ Test code locally in isolation ✦ Commit to the server without breaking builds

Slide 42

Slide 42 text

Working in a team ✦ Work locally ✦ Share work without a server ✦ Test code locally in isolation ✦ Commit to the server without breaking builds ✦ A broken build doesn’t stop development

Slide 43

Slide 43 text

No content

Slide 44

Slide 44 text

No content

Slide 45

Slide 45 text

No content

Slide 46

Slide 46 text

No content

Slide 47

Slide 47 text

No content

Slide 48

Slide 48 text

No content

Slide 49

Slide 49 text

No content

Slide 50

Slide 50 text

No content

Slide 51

Slide 51 text

Questions? ✦ [email protected] ✦ @lachlanhardy ✦ http://git-scm.com/