48

Git Ready! Workflows

Embed Size (px)

DESCRIPTION

How do you choose a git workflow that increases productivity and reduces the friction of your team? What are the battle tested practices of successful teams that moved to git? How is git used inside Atlassian? As you might have heard git has many compelling features and has gained incredible momentum in the industry at large. Yet understanding how an enterprise team can adopt it can be daunting. The presentation aims to help answer these questions and more: - Available collaboration models when using a distributed version control system like git - Branching models that foster and enhance parallel development - Emerging code best practices and choices that can be safely adopted when migrating to git - How Continuous Integration changes when your team embraces git

Citation preview

Page 1: Git Ready! Workflows
Page 2: Git Ready! Workflows

Ready! Workflows

Page 3: Git Ready! Workflows

Question timeat the end

Submit your questions

Page 4: Git Ready! Workflows

Nicola PaolucciDeveloper Advocate / Git Evangelist

@durdndurdn.comI come out nice in pictures, I know :-).

Page 5: Git Ready! Workflows

Cheap local branchingFull local history

Speed

Staging area

prominent in Open Source

Huge community

You heard has

Feature based workflow

10x the speed of svn

Distributedcryptographic integrity

Page 6: Git Ready! Workflows

ground breaking paradigm is ground breaking

Page 7: Git Ready! Workflows

Workflow building blocks

Page 8: Git Ready! Workflows

1

Common Practices

2

3

Collaboration model

We’ll cover how to choose:

Branching model

Continuous Integration4

Page 9: Git Ready! Workflows

Which collaboration model?1

Easy, right?

Page 10: Git Ready! Workflows

Fully decentralized Anarchy

I do my thingI do my thing, too

ANARCHYhere’s mine, who tells

john?look ma, a goat!

Page 11: Git Ready! Workflows

Blessed repository with Gatekeeper

He is cool

Gatekeeper

To have your work accepted, talk to him

Page 12: Git Ready! Workflows

and LieutenantsDictator

long live the King!

Lieutenants guardthe King

Blessed repository

Page 13: Git Ready! Workflows

Shared common repository

we share “everything”

luckily no goats here

Centralised

Page 14: Git Ready! Workflows

atlassian.com/gitMore on Collaboration models

Page 15: Git Ready! Workflows

+ = Centralized

Enterprise

Page 16: Git Ready! Workflows

Centralized allows fine grained ACLs

Branch & Repo permissions

Page 17: Git Ready! Workflows

Integration with your

Issue tracking and CI

Page 18: Git Ready! Workflows

Which branching model?2

Page 19: Git Ready! Workflows

Product Releases1

Continuous Delivery2

Two common Branching Models

Page 20: Git Ready! Workflows

for Product Releases2.1

Page 21: Git Ready! Workflows

One Central Repository1

One Branch per Feature

One Branch per Bugfix

2

3

Tim

emasterfeature

branches

PRJ-

123-

desc

ript

ion

Page 22: Git Ready! Workflows

One Central Repository1

One Branch per Feature

One Branch per Bugfix

2

3

Tim

emasterbugfix

branch

PRJ-

123-

bug-

desc

ript

ion

Page 23: Git Ready! Workflows

Stable Branches4

master is alpha / RC5

Pull Requests6Before merges

Long running

Tim

emasterstable

branch

PRJ-

345-

bug-

desc

ript

ion

bugfix

2.2

Page 24: Git Ready! Workflows

2.2 for Continuous Delivery

Page 25: Git Ready! Workflows

master is in production1

staging is the next version

new features off staging

2

3

with branch names like: username/ISSUE-KEY-summary

promoted from staging, can receive hot-fixes

Page 26: Git Ready! Workflows

Common Practices3

turbo boost!

Page 27: Git Ready! Workflows

What is a Pull Request?

Page 28: Git Ready! Workflows

Hey I have some code I want to merge here,

take a look?

Low friction collaboration

Pull Request

I have some code here!

Can I merge it here?

Page 29: Git Ready! Workflows

Single Repositoryvs

Remote Forks

Page 30: Git Ready! Workflows

Complete visibility1

No per Dev remotes required

KISS

2

3

Pros of a Single RepoAll feature branches available

Page 31: Git Ready! Workflows

Forks Are Great too BTW

Page 32: Git Ready! Workflows

Every one has their remote repository

With Forks

Full remote copy,each has one Integrator, Gatekeeper,

Tech Lead, etc.

Page 33: Git Ready! Workflows

Manage codebase maturity1

X department and 3rd parties

Dev to Dev interactions

2

3

Read “Cross”

Page 34: Git Ready! Workflows

Continuous Integration4

Page 35: Git Ready! Workflows

What happens to CI with git?1

An explosion of branches2

3 Performance degradation of build sys

Page 36: Git Ready! Workflows

Building everything is expensive1

Automatically build stable and master2

3 Manually trigger feature branch builds

Page 37: Git Ready! Workflows

Less Friction and Automation5

Page 38: Git Ready! Workflows

Code Quality via pre-commit hooks

Page 39: Git Ready! Workflows

Branch from green builds

Page 40: Git Ready! Workflows

Automatic merges for the win!

Page 41: Git Ready! Workflows

Tim

e

masterstable branch

PRJ-

345-

bug-

desc

ript

ion

bugfix

2.2

stable branch

2.1

Automatic MERGES!

Page 42: Git Ready! Workflows

Ripple merges1

Server side update hook2

3 Or tool support

Page 43: Git Ready! Workflows

Read more at:bitly.com/automatic-merges

Page 44: Git Ready! Workflows

In Conclusion: the recipe

Page 45: Git Ready! Workflows

BranchingModel

Adopt GitPractices

Automation & CI setup

Conclusions

Product workflow

Continuous delivery workflow

Embrace PR

Build automatically,

but leave knobs!Single Repo

or Forks

CollaborationModel

Centralized

Hooks, hooks everywhere

Page 46: Git Ready! Workflows

Nicola PaolucciTHANKS YOU FOR YOUR ATTENTION

@durdndurdn.comShould I change the pic?

Page 47: Git Ready! Workflows

Git Repository Management for Enterprise Teams

Free Git Code Hosting for Small Teams

Free Git Desktop client for Mac or Windows

Atlassian

Page 48: Git Ready! Workflows