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
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