Who knows 
?
Facts 
500 Developers
1000+ Nerds 
Facts
working on 9 products 
Facts
or in just 3 words 
We Software
We SoftwareTeams
they know what’s going on! 
really small team 
Let’s 
do it! 
Great 
idea! Productivity++
Productivity? 
team is growing 
Let’s 
do it! 
Great! Why? 
Who will 
do it? 
Is it done? 
Have you 
talked to QA? 
I have no time 
for this!
Productivity?? 
we’re not alone 
Is it 
profitable? 
When is it 
done?
Devel ping S ftware 
is a 
S cial Challenge
happy developers & 
productive teams Ship software 
Tools 
faster & smarter
Ship software 
faster & smarter 
happy developers & 
productive teams
All sorts of teams 
are on 
&
All sort of 
teams
Migrating soon? 
http://atlassian.com/git/
is just a tool!
Happier Developer 
with 
Be a
Time machine without paradoxes?
Why does make you happy? 
2 Freedom & Safety 
Explore & Understand 
1 
3 
Fast & Compact 
4 Control and Assemble
But Why? 
Or How?
A lot of the “Why” can 
be explained at the 
Conceptual model
Written in C by Linux kernel 
and filesystem developers
5 minutes dive into 
internals
Git is fundamentally a content-addressable 
filesystem with a VCS user interface written 
on top of it 
Pro Git Book, Section: Git Inter nals ” 
“
cba0a.. 
commit 
tree 
blob 
content 
blob 
content 
blob 
content 
98ca9.. 
92ec2.. 
5b1d3.. 
911e7.. 
cba0a.. 
tree 92ec2.. 
blob 5b1d3.. 
blob 911e7.. 
blob 
author 
committer 
README 
LICENSE 
test.rb 
size 
size 
size 
size 
size 
parent 
data model 
r34ti..
$> tree .git/objects 
.git/objects 
├── info 
└── pack 
2 directories
git add some-file.txt
$> tree .git/objects 
.git/objects 
├── e4 
│ └── 3a6ac59164adadac854d591001bbb10086f37d 
├── info 
└── pack 
3 directories, 1 file 
zlib compressed 
SHA1
git commit -m "First commit"
$> tree .git/objects 
.git/objects 
├── 13 
│ └── 1e360ae1a0c08acd18182c6160af6a83e0d22f 
├── 31 
│ └── 995f2d03aa31ee97ee2e814c9f0b0ffd814316 
├── e4 
│ └── 3a6ac59164adadac854d591001bbb10086f37d 
├── info 
└── pack 
5 directories, 3 files 
Commit 
Tree 
Blob
cba0a.. 
commit 
tree 
blob 
content 
blob 
content 
blob 
content 
98ca9.. 
92ec2.. 
5b1d3.. 
911e7.. 
cba0a.. 
tree 92ec2.. 
blob 5b1d3.. 
blob 911e7.. 
blob 
author 
committer 
README 
LICENSE 
test.rb 
size 
size 
size 
size 
size 
parent 
data model 
r34ti..
data model 
commit 
tree c4d.. 
author 
message: 1st! 
tree 
blob 5b1d3.. 
blob 911e7.. 
blob 
cba0a.. 
size 
size 
READM 
LICENS 
test.rb 
parent 
… 
commit 
tree c4d.. 
author 
message: Update! 
parent 8efc8.. 
tree 
blob 5b1d3.. 
blob 911e7.. 
blob 
cba0a.. 
size 
size 
READM 
LICENS 
test.rb 
… 
commit 
tree c4d.. 
author 
message: More! 
parent bc5e7.. 
tree 
blob 5b1d3.. 
blob 911e7.. 
blob 
cba0a.. 
size 
size 
READM 
LICENS 
test.rb 
… 
…
echo "// Comment" >> some-file.txt
git add some-file.txt
$> tree .git/objects 
.git/objects 
├── 13 
│ └── 1e360ae1a0c08acd18182c6160af6a83e0d22f 
├── 31 
│ └── 995f2d03aa31ee97ee2e814c9f0b0ffd814316 
├── c1 
│ └── 9e6823e34980033917b6427f3e245ce2102e6e 
├── e4 
│ └── 3a6ac59164adadac854d591001bbb10086f37d 
6 directories, 4 files 
Entirely new BLOB
wat?
git gc
$> tree .git/objects 
.git/objects 
├── info 
│ └── packs 
└── pack 
├── pack-7475314b451a882d77b1535d215def8bad0f4306.idx 
└── pack-7475314b451a882d77b1535d215def8bad0f4306.pack 
2 directories, 3 files
Loose Objects Packfile 
1. zlib compressed 
2. Delta encoded
Fast and Compact
Everything is local 
Except push & pull
Read: FAST
But what if my repo is big? 
2 12,000 non-merge commits 
446k lines of code added 
1 
3 
Linux Kernel release has 15+ million LOC 
4 1,339 contributors 
source lwn.net
Control and Assemble
What is a merge? 
merges keep the context of 
the feature’s commits 
M 
Merge commit 
feature 
master 
feature 
master
Anatomy of a merge 
.git/objects/36/80d8c8fd182f97cb0e75045e2fed5c7b7613ed 
tree f362c42032aff677c1a09c3f070454df5b411239 
parent 49a906f5722ad446a131778cea52e3fda331b706 
parent bd1174cd0f30fe9be9efdd41dcd56256340f230e 
author Marcus Bertrand <mbertrand@atlassian.com> 1409002123 -0700 
committer Marcus Bertrand <mbertrand@atlassian.com> 1409002123 -0700 
Merge branch 'foo/mybranch' 
commit
merge is better in git 
git knows the ancestry 
1 
2 
The merge is local 
3 powerful merge strategies
Let’s talk about merge strategies! 
git has breadth of choice on 
how to merge changes! 
resolve recursive octopus 
ours subtree yours?
What is a fast-forward merge? 
It will just shift the HEAD tag 
master 
feature 
master 
feature
merge strategy: resolve 
Three-way merge of the ancestors 
feature 
Common ancestor 
master M 
Merge commit
merge strategy: recursive 
3-way merge but climbs the ancestry tree 
recursively if there are multiple ancestors 
M 
M 
master 
feature 
ancestor 1 
ancestor 3 
ancestor 2
merge strategy: ours 
Records a merge but skips incoming changes 
feature 
master M 
IGNORE!
use “ours” to promote 
more recent branches
merge becomes a 
non-event
rebase: Rewrite history 
with safety belts on
What is a rebase? 
It’s a way to replay commits, 
one by one, on top of a branch 
master 
feature
When you use merge… 
You pollute your feature branch with 
non-meaningful merge commits 
not really part 
of feature… 
feature 
master 
meaningful 
merge
What is a rebase? 
It can be used to keep a feature 
branch up to date with master 
feature 
master
What is an 
--interactive rebase? 
Helps you clean up your private 
branches before publishing them 
reword 
fixup 
pick 
squash 
edit 
exec
CUSTOMARY 
WARNING! 
rebase rewrites history! 
Treat this power with great care. Only 
rewrite history of local branches or…
So what do I use? 
merge or rebase?
Merge Commit Rebase (FF) Rebase (Squash) 
No merge commits 
Verbose history 
Easy to read 
Can be more difficult 
to trace changes 
Which should I use? 
“Ugly” history 
Full traceability 
Hard to screw up 
mostly 
some
Read more on the topic! 
bit.do/merge-or-rebase
Pro tips for the road
Everyone has their favorite, but! 
Liquid prompt is awesome 
http://bit.do/liquid-prompt
Get all the alias goodness on Bitbucket 
http://bit.do/git-aliases
Why does make you happy? 
2 Freedom & Safety 
Explore & Understand 
1 
3 
Fast & Compact 
4 Control and Assemble
Happy Developerwith 
A
Productive Teamwith 
A
Why makes a team great! 
2 Improving Code Quality 
Protect Code 
1 
3 
Efficient Workflows 
4 Git & Your Toolchain
Efficient Workflows
Can we still fix a bug for the 
upcoming Release ? 
Is the code for that 
Feature 
complete? 
How do we do Hotfix 
for the current version? 
Has everyoneReviewed 
the code for this feature ?
We don’t know! 
What’s the best 
Git workflow?
different cultures 
+ different products 
+ different teams 
= different workflows 
What’s the best 
Git workflow?
Design 
your own 
Workflows
Issues Code
Issues Code 
JIRA-123 JIRA-123 
JIRA-456 
JIRA-456
Can’t be released right now 
Unfinished features in your trunk / master branch
Branch per issue First: 
feature/JIRA-30 
stable master branch 
isolated feature work 
master
Branch per issue First: 
feature/JIRA-30-user-avatars 
branch type 
issue key 
description
Branch per issue First: 
bugfix/JIRA-31-oauth-3lo-NPE 
branch type 
issue key 
description
Branch per issue First: 
hotfix/JIRA-32-broke-ie8-again 
branch type 
issue key 
description
Typos happne! 
Tool switching sucks
Is the branch green? 
Branch name 
pre-populated
Confounding build breakages 
master
Confounding build breakages 
bugfix/JRA-1 
master
Is the branch green? 
Branch name 
pre-populated
SAAS Workflow 
1 Atlassian Marketplace 
Workflow
Simplest Workflow 
release from here 
master 
feature/JIRA-30 
feature/JIRA-45
Simplest Workflow 
release from here 
master 
develop 
feature/JIRA-30 
feature/JIRA-45 
integrate here
Installable software 
2 Atlassian Stash 
Workflow
Multiple Product Versions 
v 1.1 
v 1.2 
master 
feature/JIRA-30
Multiple Product Versions 
v 1.1 
bugfix/JIRA-41 
v 1.2 
master