Professional Documents
Culture Documents
Developer Advocate
@kannonboy
Ian Buchanan
Developer Advocate
@devpartisan
Git at Atlassian
10 min
Happier Developers
40 min
Break
10 min
Better Teams
40 min
A bit about Stash
10 mins
Who knows
Facts
500 Developers
Facts
1000+ Nerds
Facts
working on 9 products
Tools
Ship software
faster & smarter
Ship software
faster & smarter
Migrating soon?
http://atlassian.com/git/
is just a tool!
Be a
Happier Developer
with
Why does
internals
$> cd ~/repo-directory
!
$> ls -A
!
$> ls -A
.git
2 directories
3 directories, 1 file
zlib compressed
SHA1
5 directories, 3 files
Commit
Tree
Blob
data model
98ca9..
commit
size
e34bf..
parent
author
committer
tree
92ec2..
5b1d3..
blob
content
92ec2..
tree
blob 5b1d3..
blob 911e7..
blob cba0a..
size
911e7..
size
README
LICENSE
test.rb
blob
size
content
cba0a..
blob
content
size
6 directories, 4 files
git gc
2 directories, 3 files
Loose Objects
Packfile
Delta encoded
zlib compressed
Everything is local
Mostly C,
written by Linux kernel and
filesystem developers
1,339 contributors
source lwn.net
Branching
git stash
Create a patch without a hassle
Redundancy
Every developer has a clone
Chain of unlosability
Recover a file
git checkout file-name
Recover a commit
git checkout sha-1
or
git checkout ref (branch/tag)
reflog
More on recovery!
http://bit.do/recovering
Ask
What is a merge?
merges keep the context of
the features commits
Merge commit
re
u
at
e
f
feature
master
er
t
s
Anatomy of a merge
.git/objects/36/80d8c8fd182f97cb0e75045e2fed5c7b7613ed
commit
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'
resolve
recursive
octopus
ours
subtree
yours?
re
u
at
e
f
feature
master
m
r
te
s
a
Common ancestor
feature
master
ce
n
a
master
ancestor 3
feature
ce
n
a
r2
o
st
merge becomes a
non-event
What is a rebase?
Its a way to replay commits,
one by one, on top of a branch
feature
master
feature
What is a rebase?
It can be used to keep a feature
branch up to date with master
master
feature
What is an
--interactive rebase?
Helps you clean up your private
branches before publishing them
pick
squash
reword
fixup
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?
Rebase (FF)
Rebase (Squash)
Ugly history
No merge commits
Easy to read
Full traceability
Verbose history
Hard to screw up
mostly
some
Why does
Happy Developerwith
Why
Eicient Workflows
Ecient Workflows
We dont know!
different cultures
+ different products
+ different teams
= different workflows
Design
your own
Workflows
Issues
Code
Issues
Code
JIRA-123
JIRA-456
JIRA-123
JIRA-456
First:
master
feature/JIRA-30
First:
description
feature/JIRA-30-user-avatars
issue key
First:
description
bugfix/JIRA-31-oauth-3lo-NPE
issue key
First:
description
hotfix/JIRA-32-broke-ie8-again
issue key
Typos happne!
Tool switching sucks
Branch name
pre-populated
master
bugfix/JRA-1
master
Branch name
pre-populated
SAAS Workflow
1 Atlassian MarketplaceWorkflow
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
v 1.2
master
feature/JIRA-30
v 1.1
bugfix/JIRA-41
v 1.2
master
v 1.1
bugfix/JIRA-41
v 1.2
master
v 1.1
v 1.2
master
v 1.1
v 1.2
master
v 1.1
v 1.2
master
boring work
Automatic merges
with Stash
Improving
Code Quality
Code
Review
Better
Code
Shared
Knowledge
Team
Ownership
Developer guilt
=
G
1
R+1
Team
Ownership
Code Reviews
Pull Requests
Pull Requests
Pull Requests
do it before merge
Discuss
Who would be
my code?
Add
O
n Fo
Suggestions:
committed code to this
Pull Request
& CI
Building branches
always build master
master
automatically
triggered
Issue
Issue
Sprint
Build
Branch
Pull Request
OPEN
IN PROGRESS
IN REVIEW
DONE
Branch created!
feature/JIRA-30
OPEN
IN PROGRESS
IN REVIEW
DONE
feature/JIRA-30
OPEN
IN PROGRESS
IN REVIEW
DONE
OPEN
IN PROGRESS
IN REVIEW
DONE
Webinar
tinyurl.com/jirastash
Issues
Branches
Pull Requests
etc.
Issues
Branches
Pull Requests
etc.
Why Git?
Ship software faster & smarter
Why Git?
Why
Commit
Log
Why
Git workflows
for teams
Extensions
&
Integrations
Scalability
master
feature/STASH-123
feature/STASH-123
feature/STASH-123
feature/STASH-123
Flexible &
Extensible
Powerful integrations
Powerful integrations
Plugin APIs
Full Java API
Repository Hooks
Merge Checks
User Interface
REST end-points
Filetype renderers
SSH commands
Stash Platform
Branch
Permissions
REST APIs
JIRA
Integration
RESTful APIs
insert /rest/api/latest
RESTful APIs
insert /rest/api/latest
Scalability
Request throttling
Scalability
Request queuing
Scalability
Response Caching
Scalability
Clustering
Why
Git workflows
for teams
Extensions
&
Integrations
Scalability
Ch ee se!
want a shirt?
#gettinggitright
#gettinggitright
Q&A
$10 for up to 10 devs
Totally free