WiFi: username / password
A couple of Atlassians who get Git and dig the DAG
Tim PettersenDeveloper Advocate
@kannonboy
Abhin ChhabraBitbucket Developer
@abhin_chhabra
The State of Git 15 min
Happier Developers 40 min
A bit about Stash 10 mins
Productive Teams 40 min
Break 10 min
• Fill out survey, win awesome stuff (check the email you registered with)
!
• Tweet stuff with #gettinggitright !
• WiFi: username / password !
• Bathroom?
Who knows
?
Facts
500 Developers
Facts
1000+ Nerds
Facts
working on 9 products
SoftwareWe
or in just 3 words
SoftwareWe Teams
really small team
they know what’s going on!
Let’s do it!
Great idea!
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?
Productivity??
we’re not alone
Is it profitable?!
When is it done?!
is a
Devel ping S ftware
S cial Challenge
Tools
happy developers & productive teams Ship software
faster & smarter
Ship software faster & smarter
happy developers & productive teams
Git is on the rise
15%
38%
from 2011 to 2013Source: RedMonk Git Survey 2013
Git will continue to grow!
63%
37%
December 2015
Git
CVS + SVN
Source: Atlassian Git Survey 2013
Git works for the enterprise!
60%100+ developers
1,000+ employees
Source: Atlassian Git Survey 2013
Git works for the enterprise!
27%
69%
use the cloud
develop on-premise
Source: CollabNet Git Survey 2013
Git means fast releases
Git
SVN CVS
mainly daily - weekly
mainly monthly
Source: Atlassian Git Survey 2013
Better code with Git
Code Reviews when using GIT
+15% more
thank you Pull Requests!
Source: Atlassian Git Survey 2013
atlassian.com/git
Migrating soon?
is just a tool!
WiFi: bcenter
Happier Developerwith
Be a
Erik van Zijst!Bitbucket Developer
Tim Pettersen!Developer Advocate
September 2014!with! and!
Happier Developerwith
Be a
Abhin Chhabra !Bitbucket Developer
Tim Pettersen!Developer Advocate
September 2014!with! and!
Time machine without paradoxes?
Explore & Understand
1
3
Speed, Speed, Speed
Control and Assemble4
Why does make you happy?
2 Freedom & Safety
1
Fast is the new Black
Speed, speed, Speed
Everything is local
Except push & pull
Written in C by Linux kernel and filesystem
developers
Read: fast :D
But what if my repo is big?
446k lines of code added
1
3
Recent Linux kernel release (3.13) has 15+ million LOC
1,339 contributors4
2 12,000 non-merge commits
source lwn.net
2 Freedom & Safety
Feature Branching
Feature Branching
Feature branches: local
git checkout -b new-branch creates a branch and switches to it
Feature branches: published (remote)
git push origin new-branch pushes a local branch remotely
git stash is awesomeIt’s a way to
temporarily save your work on a stack
So if your boss comes screaming at your desk
Safety
Losing work is very hard
very very
maybe your git server crashed and the hd is
corrupted?… no problem
Redundancy, every developer has a clone
Chain of unlosability
Recover a file
git checkout file-name
Recover a commit
git checkout sha-1
git checkout ref (branch/tag)
or
Print file as in branch
git show branch:path/to/file
can be any ref
find a deleted method
git log -S<string> search through all history
When all is lost, use the reflog
More on recovery!http://bit.do/recovering
Explore & Understand 3
= history superpowers
Hard Questions to git logAsk
-S string in all diffs--after,--before when?--author who did what
Who deleted that?git log -1 -- [path] lists where a file was deleted
git log --diff-filter=D --summary lists all deleted files
Where is that constant?
git grep <regexp> compare the speed between this and regular grep or ack…you’ll be blown
away
have I merged this?
git branch --no-merged lists branches not merged
git branch --merged lists branches already merged
Control and Assemble4
What is a merge?
Merge commit
master
feature
merges keep the context of the
feature’s commits
git knows the ancestry
1
2
The merge is local
powerful merge strategies3
merge is better in git
merge becomes a non-event
In most cases
rebase: Rewrite history with safety belts on
feature
master
What is a rebase?
It’s a way to replay commits, one by one,
on top of a branch
master
feature
What is a rebase?
preserving the order of commits
What is an --interactive rebase?
It’s a way to replay commits, one by one,
deciding interactively what to do with each
reword fixup
pick squash
edit exec
CUSTOMARY WARNING!
rebase rewrites history!
Treat this power with great care. Only rewrite history of local branches or…
Explore & Understand
1
3
Speed, Speed, Speed
Control and Assemble4
Why does make you happy?
2 Freedom & Safety
Happy Developerwith
A
WiFi: bcenter
Productive Team withA
Improving Code Quality
1
2
Efficient Workflows
Better Collaboration3
Why makes a team great!
4 Natural Fit
Efficient Workflows
upcoming Release ?Can we still fix a bug for the
FeatureIs the code for that
complete?
for the current version?HotfixHow do we
do
ReviewedHas everyone
the code for this feature ?
Git workflow?What’s the best
We don’t know!
+ different teams+ different products
different cultures
= different workflows
Git workflow?What’s the best
DesignWorkflows
your own
Issues Code
Issues Code
JIRA-456
JIRA-123JIRA-123
JIRA-456
Can’t be released right now
Unfinished features in your trunk / master branch
Branch per issueFirst:
feature/JIRA-30
stable master branch
isolated feature work
master
feature/JIRA-30-user-
Branch per issueFirst:
branch type
issue key
description
bugfix/JIRA-31-
Branch per issueFirst:
branch type
issue key
description
hotfix/JIRA-32-broke-
Branch per issueFirst:
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/
master
Atlassian Marketplace1Workflow
SAAS Workflow
Simplest Workflow
release from here
feature/JIRA-30
feature/JIRA-45
master
Simple Workflowrelease from here
feature/JIRA-30
feature/JIRA-45
develop
masterintegrate here
Atlassian Stash2Workflow
Installable software
Multiple Product Versions
feature/JIRA-30
master
v 1.2
v 1.1
Multiple Product Versions
master
v 1.2
v 1.1
bugfix/JIRA-41
Multiple Product Versions
master
v 1.2
v 1.1
bugfix/JIRA-41
Multiple Product Versions
master
v 1.2
v 1.1
bugfix/JIRA-45
Multiple Product Versions
master
v 1.2
v 1.1
bugfix/JIRA-45
Multiple Product Versions
master
v 1.2
v 1.1
bugfix/JIRA-45
boring work
Automatic merges
https://bitbucket.org/durdn/automatic-merge-hook
with a Git hook
Automatic mergeswith Stash
Design your workflow
Nearly everything is possible with
Improving Code Quality
CodeReview
Photo: Yogi (Flickr)
Better Code
Shared Knowledge
Team Ownership
G = 1
R+1
Developer guilt
Team Ownership
Code Reviews
Pull Requests
Pull Requests
do it before merge
Pull Requests
Pull Request Creation
Pull Request Creation
Pull Request Creation
Discuss
Discuss your changes
Discuss your changes
Side by side diff the choice is yours
invited reviewers
invited reviewers
minimum X approvals
Go merge!
Pull Request Merge Checks
Who would be
the best to reviewmy code?
Auto Suggest Reviewers
Free Add On For
Auto Suggest Reviewers
suggestions
why?
committed code to this Pull Request
Suggestions:
contributed files that were modified
Better Collaboration
Working with contractors?
Circle of Trust
Photo: Aljaz Zajc
Strangers on the internet
Contractors
Interns
Other product teams
SupportCore dev team
Circle of Trust
Collaboration with SVN
Core dev team
Everyone else
emailing patches repository tarballs hell-ish conflicts
Collaboration with forks
Everyone else
Core dev team Changes
automatically synchronize downstream
.. but must be reviewed
before moving upstream
feature
Collaboration with branches
Senior developers
Junior developers
maste
Permissions for Branches with
Permissions for Branches with
Strangers on the internet
Interns
Other product teams
SupportCore dev team
Contractors
Know your priorities
Security DevSpeed
Natural Fit
to your existing flow
There is so much going on in our projects!
Pull Requests
Sprints
Builds
Issues
Branches
& CI
manually triggered
automatically triggered
Building branches
maste
always build master
Less time configuringmore time to code
Every line of code starts with
Real Life Problema
Every line of code starts with
Issuean
Visualize your development
IN PROGRESS
Status People Code
Issue
good old days
Visualize your development
Issue
Sprint Branch Pull Request
Build
2014 style
Visualize your development
Automatic Issue Transitions
feature/JIRA-30
master
IN REVIEW DONEIN PROGRESSOPEN
See what’s going onBuildswithBots
PagesIssues Branches Pull Requests etc.
More time to codeBetter collaborationDev productivityThe future
Economics
Why Git?
Deliver software faster
Less bugs
Happy customers
Why Git?
Ship software faster & smarter
So now you can answer “Why Git?”
Let’s talk a little bit about “Why ?”
Why ?
157
1. BEST enterprise Git workflow 2. Integrations & extensibility 3. Scalability
158
feature/STASH-123
master
The Best Git Workflow
X reviewers approved? Y builds passed? All tasks complete?
159
feature/STASH-123
master
The Best Git Workflow
• Pull request merge checks • Repository hooks • Branch permissions • Flexibility & extensibility
160
Powerful integrations
161
Plugin APIs • Full Java API • Repository Hooks • Merge Checks • User Interface • REST end-points • Filetype renderers • SSH commands
Stash Platform
Branch Permissions REST APIs Git SCM
Source? You betcha!
162
RESTful APIs insert /rest/api/latest
163
RESTful APIs insert /rest/api/latest
164
Scalability
Request prioritization
165
Scalability
Request queuing
166
Scalability
Response Caching
167
Scalability
Clustering
All sorts of teams are on&
Why ?
170
• BEST enterprise Git workflow • Integrations & extensibility • Scalability
Please fill out our survey
to get a t-shirt
win wireless headphones
tweet #gettinggitright
Fill out our survey to
Get a “Stash” photo and
(check your email)
Q & A$10 for up to 10 devs
Free for 5 users Totally free
Free basic version