popular git workflows you haven't heard about

17
NICOLA PAOLUCCI DEVELOPER ADVOCATE ATLASSIAN @DURDN Popular Git workflows You haven’t heard about

Upload: atlassian

Post on 19-Mar-2017

4.195 views

Category:

Technology


2 download

TRANSCRIPT

NICOLA PAOLUCCI • DEVELOPER ADVOCATE • ATLASSIAN • @DURDN

Popular Git workflowsYou haven’t heard about

22

THE SOLUTION TO EVERYTHING

git force --push

The Golden Bunch The Old Guard The Squashin’ aka NO MERGES!

Same challenge, different approaches

We all know branching is awesome

master

HEAD

HEAD

new-feature

55

MASSIVELY SUCCESSFUL WORKFLOWS

The Golden Bunch

Mainstream and successful workflows

Git Flow

Influential and popular with a clear consistent structure and process

Bitbucket Cloud Flow

Simple setup with two main branches: master and develop

Product Releases

To maintain older versions with long running maint. branches

Bitbucket Cloud workflow in a nutshell

mstaging

master

feature-1

feature-2

m m

release to production = merge to master

m

R H

Stable - ProductionRelease

Only merges

88

RUN IT VIA A MAILING LIST

The Old Guard: how the Git project itself does it

Workflow of Git core team

Different branching

Patches via Email

ML is the Central hubEvery code discussion happens in public on the Git mailing list

Patches sent via email and are discussed publicly until consensus

Branching structure is different than the ones you may be used to

Workflow of Git core team

Branches are Fluidnext and maint are reset after each release

pu - proposed updates

next

master

pu

np/topic

master - used to prepare for feature release v2.8.0

next - features in good shape may have regressions

maint

maint - maintenance fixes after releases

m m m

Git core team branching model

m

Rm m

1212

SOME TEAMS LIKE LINEAR HISTORY

The Squashin’ AKA The NO MERGES

When the team size grows, looking back at past development using branches becomes harder (not a real quote)L U K A S Z W L O D A R C Z Y KJ I R A R E L E A S E M A N A G E R , AT L A S S I A N

“”

feature

Squashin’ all and avoid merges onto master

staging

master

master uses fast-forward merges thus has just clean commits

Flat historyEasier debugging SourceTree is happy

Enforce a strict no-merges policy

A flat history may make using git blame

and bisect easier

A flat history is easier to read. Intermediate

commits are rare

Avoid the ui cluttering of an endless forest of

branches

Squashing

You can do this now with Bitbucket Server!

Fast-forwarding

On completing a PR you can now squash all commits down to a single one.

If you don’t like the clutter of merge commits you can enforce fast-forward merges.

Thank you!

NICOLA PAOLUCCI • DEVELOPER ADVOCATE • ATLASSIAN • @DURDN

Tweet at me @durdn