real world git workflows - eclipsecon europe 2013

176
Real World Workflows

Upload: nicola-paolucci

Post on 06-May-2015

1.070 views

Category:

Technology


7 download

DESCRIPTION

While Git is established in the Open Source world, we're only just seeing the emergence of DVCS in our daily jobs. How can DVCS enable us to collaborate in a traditional "enterprise" setting. Atlassian has fully embraced DVCS and has started to build features into their suite of products to take advantage of this new and exciting paradigm. The talk will dive deep into the successful git work flows used inside Atlassian. There is no size fit all for this topic and various effective processes can be devised and are in active used at our company. The talk will also cover tools and techniques used to reduce friction during the development of features and bugfix releases like for example pre/post receive hooks and automatic merges. Outline: * Software Development Practices And DVCS - Branch vs fork (single server/repo, vs forks) - Code quality (pre-commit hook, pre-checkout hook, pre-receive, see below) * Awesome Git Workflows Used Internally At Atlassian - Continuous Delivery Branching model - Product Releases Branching model * Streamlining Your Git Process - merge vs rebase - Rebase as cleanup - Meaningful merges - hooks . hooks in general . Post-checkout checks . pre-commit hooks . Great Pre-receive and Post-receive hooks - Automatic merges * How does CI change when you move to git?

TRANSCRIPT

Page 1: Real World Git Workflows - EclipseCon Europe 2013

Real World Workflows

Page 2: Real World Git Workflows - EclipseCon Europe 2013
Page 3: Real World Git Workflows - EclipseCon Europe 2013

Nicola PaolucciDeveloper Advocate / Git Evangelist

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

Page 4: Real World Git Workflows - EclipseCon Europe 2013

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 5: Real World Git Workflows - EclipseCon Europe 2013

ground breaking paradigm is ground breaking

Page 6: Real World Git Workflows - EclipseCon Europe 2013

Workflow building blocks

rebasepowerful merging

fork

clone

cheap branching

distributed

Page 7: Real World Git Workflows - EclipseCon Europe 2013

RELEASECan we fix a bug for the

upcoming?

FEATUREIs the code for that

complete?

BUILDCan we

the current code ?

REVIEWEDHas everybody

the code for this feature ?

HOTFIXCan we do a fast

for the current release?

Page 8: Real World Git Workflows - EclipseCon Europe 2013

What we’ll cover:

Page 9: Real World Git Workflows - EclipseCon Europe 2013

1

What we’ll cover:

Branching models

Page 10: Real World Git Workflows - EclipseCon Europe 2013

Practices & Decisions

1

2

What we’ll cover:

Branching models

Page 11: Real World Git Workflows - EclipseCon Europe 2013

Practices & Decisions

1

2

What we’ll cover:

Branching models

Tooling & Automation3

Page 12: Real World Git Workflows - EclipseCon Europe 2013

Practices & Decisions

1

2

What we’ll cover:

Branching models

Tooling & Automation3

4 Continuous Integration

Page 13: Real World Git Workflows - EclipseCon Europe 2013

Which branching model?

Page 14: Real World Git Workflows - EclipseCon Europe 2013

Which branching model?1

Page 15: Real World Git Workflows - EclipseCon Europe 2013

Two common Branching Models

Page 16: Real World Git Workflows - EclipseCon Europe 2013

1 Continuous Delivery

Two common Branching Models

Page 17: Real World Git Workflows - EclipseCon Europe 2013

Product Releases

1 Continuous Delivery

2

Two common Branching Models

Page 18: Real World Git Workflows - EclipseCon Europe 2013

for Continuous Delivery

Page 19: Real World Git Workflows - EclipseCon Europe 2013

1.1 for Continuous Delivery

Page 20: Real World Git Workflows - EclipseCon Europe 2013

Tim

emaster/

productionstagingfeature

Page 21: Real World Git Workflows - EclipseCon Europe 2013

Tim

emaster/

productionstagingfeature

master is in production

Page 22: Real World Git Workflows - EclipseCon Europe 2013

Tim

emaster/

productionstagingfeature

master is in production

staging is the next version

Page 23: Real World Git Workflows - EclipseCon Europe 2013

Tim

emaster/

productionstagingfeature

master is in production

staging is the next version

new features off staging

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

Page 24: Real World Git Workflows - EclipseCon Europe 2013

Tim

emaster/

productionstagingfeature

master is in production

staging is the next version

new features off staging

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

PR

Page 25: Real World Git Workflows - EclipseCon Europe 2013

Tim

emaster/

productionstagingfeature

master is in production

staging is the next version

new features off staging

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

promoted from staging, can receive hotfixes

PR

Page 26: Real World Git Workflows - EclipseCon Europe 2013

Tim

emaster/

productionstagingfeature

master is in production

staging is the next version

new features off staging

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

promoted from staging, can receive hotfixes

Hotfix

PR

Page 27: Real World Git Workflows - EclipseCon Europe 2013

Tim

emaster/

productionstagingfeature

master is in production

staging is the next version

new features off staging

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

promoted from staging, can receive hotfixes

Hotfix

PR

Page 28: Real World Git Workflows - EclipseCon Europe 2013

for Product Releases

Page 29: Real World Git Workflows - EclipseCon Europe 2013

for Product Releases1.2

Page 30: Real World Git Workflows - EclipseCon Europe 2013
Page 31: Real World Git Workflows - EclipseCon Europe 2013

One Central Repository1

Page 32: Real World Git Workflows - EclipseCon Europe 2013

One Central Repository1

One Branch per Feature2

Tim

emasterfeature

branches

PRJ-

123-

desc

ript

ion

Page 33: Real World Git Workflows - EclipseCon Europe 2013

One Central Repository1

One Branch per Feature

One Branch per Bugfix

2

3

Tim

emasterbugfix

branch

PRJ-

123-

bug-

desc

ript

ion

Page 34: Real World Git Workflows - EclipseCon Europe 2013

Tim

emasterrelease

branch

PRJ-

345-

bug-

desc

ript

ion

bugfix

2.2

Page 35: Real World Git Workflows - EclipseCon Europe 2013

Release Branches4

Tim

emasterrelease

branch

PRJ-

345-

bug-

desc

ript

ion

bugfix

2.2

Page 36: Real World Git Workflows - EclipseCon Europe 2013

Release Branches4

Long running

Tim

emasterrelease

branch

PRJ-

345-

bug-

desc

ript

ion

bugfix

2.2

Page 37: Real World Git Workflows - EclipseCon Europe 2013

Release Branches4

master is alpha / RC5

Long running

Tim

emasterrelease

branch

PRJ-

345-

bug-

desc

ript

ion

bugfix

2.2

Page 38: Real World Git Workflows - EclipseCon Europe 2013

Automatic merges for the win!

Page 39: Real World Git Workflows - EclipseCon Europe 2013

PRJ-

345-

bug-

desc

ript

ion

Tim

e

release branch

master

2.2

release branch

bugfix

2.1

Page 40: Real World Git Workflows - EclipseCon Europe 2013

PRJ-

345-

bug-

desc

ript

ion

Tim

e

release branch

master

2.2

release branch

bugfix

2.1

Automatic MERGES!

Page 41: Real World Git Workflows - EclipseCon Europe 2013

PRJ-

345-

bug-

desc

ript

ion

Tim

e

release branch

master

2.2

release branch

bugfix

2.1

Automatic MERGES!

Page 42: Real World Git Workflows - EclipseCon Europe 2013

PRJ-

345-

bug-

desc

ript

ion

Tim

e

release branch

master

2.2

release branch

bugfix

2.1

Automatic MERGES!

Page 43: Real World Git Workflows - EclipseCon Europe 2013
Page 44: Real World Git Workflows - EclipseCon Europe 2013
Page 45: Real World Git Workflows - EclipseCon Europe 2013

Placeholder for changes you DON’T want to merge!

Page 46: Real World Git Workflows - EclipseCon Europe 2013

release branch

2.2

release branch

2.1

2.2.1

Page 47: Real World Git Workflows - EclipseCon Europe 2013

release branch

2.2

release branch

2.1

2.1.4

2.2.1

Page 48: Real World Git Workflows - EclipseCon Europe 2013

release branch

2.2

release branch

2.1

2.1.4

2.2.1

2.1.5-SNAPSHOT

Page 49: Real World Git Workflows - EclipseCon Europe 2013

release branch

2.2

release branch

2.1

2.1.4

2.2.1

We don’t want to merge the 2.1.x version!

2.1.5-SNAPSHOT

Page 50: Real World Git Workflows - EclipseCon Europe 2013

release branch

2.2

release branch

2.1

2.1.4

2.2.1

We don’t want to merge the 2.1.x version!

2.1.5-SNAPSHOT

What can we do here?

Page 51: Real World Git Workflows - EclipseCon Europe 2013

git merge

Page 52: Real World Git Workflows - EclipseCon Europe 2013

git mergegit merge --strategy= resolve

Page 53: Real World Git Workflows - EclipseCon Europe 2013

git merge --strategy= recursive

Page 54: Real World Git Workflows - EclipseCon Europe 2013

git merge --strategy=

Page 55: Real World Git Workflows - EclipseCon Europe 2013

git merge --strategy= ours

Page 56: Real World Git Workflows - EclipseCon Europe 2013

stable branch

2.2

stable branch

2.1

2.1.4

2.2.1

2.1.5-SNAPSHOT

Page 57: Real World Git Workflows - EclipseCon Europe 2013

stable branch

2.2

stable branch

2.1

2.1.4

2.2.1

2.1.5-SNAPSHOT

$> git checkout stable-2.2$> git merge -s ours stable-2.1

Page 58: Real World Git Workflows - EclipseCon Europe 2013

stable branch

2.2

stable branch

2.1

2.1.4

2.2.1

2.1.5-SNAPSHOT

merge commit, content discarded$> git checkout stable-2.2

$> git merge -s ours stable-2.1

Page 59: Real World Git Workflows - EclipseCon Europe 2013

Deep breath, it’s really simple

Page 60: Real World Git Workflows - EclipseCon Europe 2013

The merge protocolThe secret sauce

Release branch

Page 61: Real World Git Workflows - EclipseCon Europe 2013

The merge protocolThe secret sauce

When a branch is: Change flows from branch to baseline:

Change flows from baseline to branch:

More stable than its baseline

Less stable than its baseline

Continuously Never

When code complete Continuously

Release branch

Page 62: Real World Git Workflows - EclipseCon Europe 2013

The merge protocolThe secret sauce

When a branch is: Change flows from branch to baseline:

Change flows from baseline to branch:

More stable than its baseline

Less stable than its baseline

Continuously Never

When code complete Continuously

Release branch

Page 63: Real World Git Workflows - EclipseCon Europe 2013

The merge protocolThe secret sauce

When a branch is: Change flows from branch to baseline:

Change flows from baseline to branch:

More stable than its baseline

Less stable than its baseline

Continuously Never

When code complete Continuously

Release branch

Release branch

Page 64: Real World Git Workflows - EclipseCon Europe 2013

The merge protocolThe secret sauce

When a branch is: Change flows from branch to baseline:

Change flows from baseline to branch:

More stable than its baseline

Less stable than its baseline

Continuously Never

When code complete Continuously

Release branch

Release branch

Page 65: Real World Git Workflows - EclipseCon Europe 2013

The merge protocolThe secret sauce

When a branch is: Change flows from branch to baseline:

Change flows from baseline to branch:

More stable than its baseline

Less stable than its baseline

Continuously Never

When code complete Continuously

Release branch

Release branch

Page 66: Real World Git Workflows - EclipseCon Europe 2013

The merge protocolThe secret sauce

When a branch is: Change flows from branch to baseline:

Change flows from baseline to branch:

More stable than its baseline

Less stable than its baseline

Continuously Never

When code complete Continuously

Release branch

Release branch

Page 67: Real World Git Workflows - EclipseCon Europe 2013

The merge protocolThe secret sauce

When a branch is: Change flows from branch to baseline:

Change flows from baseline to branch:

More stable than its baseline

Less stable than its baseline

Continuously Never

When code complete Continuously

Release branch

Release branch

Feature branches

Page 68: Real World Git Workflows - EclipseCon Europe 2013

The merge protocolThe secret sauce

When a branch is: Change flows from branch to baseline:

Change flows from baseline to branch:

More stable than its baseline

Less stable than its baseline

Continuously Never

When code complete Continuously

Release branch

Release branch

Feature branches

Page 69: Real World Git Workflows - EclipseCon Europe 2013

The merge protocolThe secret sauce

When a branch is: Change flows from branch to baseline:

Change flows from baseline to branch:

More stable than its baseline

Less stable than its baseline

Continuously Never

When code complete Continuously

Release branch

Release branch

Feature branches

Page 70: Real World Git Workflows - EclipseCon Europe 2013

The merge protocolThe secret sauce

When a branch is: Change flows from branch to baseline:

Change flows from baseline to branch:

More stable than its baseline

Less stable than its baseline

Continuously Never

When code complete Continuously

Release branch

Release branch

Feature branchesCredit: Laura Wingerd - The Flow of change

Page 71: Real World Git Workflows - EclipseCon Europe 2013

The merge protocolThe secret sauce

Release branch

Release Branch

Master

Page 72: Real World Git Workflows - EclipseCon Europe 2013

The merge protocolThe secret sauce

Release branch

Release Branch

Master

Mergecontinuously

Page 73: Real World Git Workflows - EclipseCon Europe 2013

The merge protocolThe secret sauce

Release branch

Release Branch

Master

Mergecontinuously

Never merge!

Page 74: Real World Git Workflows - EclipseCon Europe 2013

The merge protocolThe secret sauce

Release branch

Release Branch

Master

Mergecontinuously

Backport single changes using git cherry-pick

Never merge!

Page 75: Real World Git Workflows - EclipseCon Europe 2013

Practices & Decisions

Page 76: Real World Git Workflows - EclipseCon Europe 2013

Practices & Decisions2

turbo boost!

Page 77: Real World Git Workflows - EclipseCon Europe 2013

What is a Pull Request?

Page 78: Real World Git Workflows - EclipseCon Europe 2013

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 79: Real World Git Workflows - EclipseCon Europe 2013

Does a debate even exist?

Merge vs Rebase

MER

GE REBA

SE

Page 80: Real World Git Workflows - EclipseCon Europe 2013

What is a Rebase?

master

feature

Page 81: Real World Git Workflows - EclipseCon Europe 2013

What is a Rebase?Merge commit

master

feature

Page 82: Real World Git Workflows - EclipseCon Europe 2013

master

feature

What is a Rebase?Merge commit

master

feature

Page 83: Real World Git Workflows - EclipseCon Europe 2013

master

feature

What is a Rebase?Merge commit

master

feature

Page 84: Real World Git Workflows - EclipseCon Europe 2013

master

feature

What is a Rebase?Merge commit

master

feature

Page 85: Real World Git Workflows - EclipseCon Europe 2013

master

feature

What is a Rebase?Merge commit

master

feature

Page 86: Real World Git Workflows - EclipseCon Europe 2013

Merge as team policy

Page 87: Real World Git Workflows - EclipseCon Europe 2013

Traceability1

Merge as team policy

Page 88: Real World Git Workflows - EclipseCon Europe 2013

Traceability1

At a cost: readability2

Merge as team policy

Page 89: Real World Git Workflows - EclipseCon Europe 2013

Traceability1

At a cost: readability2

3

Merge as team policy

bisect debugging is harder

Page 90: Real World Git Workflows - EclipseCon Europe 2013

Traceability1

At a cost: readability2

3

Merge as team policy

bisect debugging is harder

with no fast-forwards

Page 91: Real World Git Workflows - EclipseCon Europe 2013
Page 92: Real World Git Workflows - EclipseCon Europe 2013

Rebase as team policy [1]

Page 93: Real World Git Workflows - EclipseCon Europe 2013

History flat and clean1

Rebase as team policy [1]

Page 94: Real World Git Workflows - EclipseCon Europe 2013

History flat and clean1

Delicate with Pull Requests2

Rebase as team policy [1]

Page 95: Real World Git Workflows - EclipseCon Europe 2013

History flat and clean1

Delicate with Pull Requests

Dangerous for unexperienced

2

3

Rebase as team policy [1]

Page 96: Real World Git Workflows - EclipseCon Europe 2013

Rebase as team policy [2]

Page 97: Real World Git Workflows - EclipseCon Europe 2013

Re-resolve similar conflicts4

Rebase as team policy [2]

Page 98: Real World Git Workflows - EclipseCon Europe 2013

Re-resolve similar conflicts4

Requires often a force push5

Rebase as team policy [2]

Page 99: Real World Git Workflows - EclipseCon Europe 2013

Re-resolve similar conflicts4

Requires often a force push

Loses context for feature

5

6

Rebase as team policy [2]

Page 100: Real World Git Workflows - EclipseCon Europe 2013

Rebase as a local cleanup

Page 101: Real World Git Workflows - EclipseCon Europe 2013

Do it1

Rebase as a local cleanup

Page 102: Real World Git Workflows - EclipseCon Europe 2013

Do it1

Rebase as a local cleanup

git rebase --interactive

Page 103: Real World Git Workflows - EclipseCon Europe 2013

Do it1

Do it2

Rebase as a local cleanup

git rebase --interactive

Page 104: Real World Git Workflows - EclipseCon Europe 2013

Do it1

Do it

Do it!!!!!!

2

3

Rebase as a local cleanup

git rebase --interactive

Page 105: Real World Git Workflows - EclipseCon Europe 2013

Recommendation?

Page 106: Real World Git Workflows - EclipseCon Europe 2013

If team unfamiliar, don’t rebase1

Recommendation?

Page 107: Real World Git Workflows - EclipseCon Europe 2013

If team unfamiliar, don’t rebase1

Encourage rebase as cleanup2

Recommendation?

and proper ecology

Page 108: Real World Git Workflows - EclipseCon Europe 2013

If team unfamiliar, don’t rebase1

Encourage rebase as cleanup

Choose clean or traceable

2

3

Recommendation?

and proper ecology

Page 109: Real World Git Workflows - EclipseCon Europe 2013

Recommendation?

Page 110: Real World Git Workflows - EclipseCon Europe 2013

Don’t fear the Merge! Use it!4

Recommendation?

Page 111: Real World Git Workflows - EclipseCon Europe 2013

Don’t fear the Merge! Use it!4

Recommendation?Explicit merges into the mainline

Page 112: Real World Git Workflows - EclipseCon Europe 2013

Don’t fear the Merge! Use it!4

Recommendation?

git log --first-parent

Explicit merges into the mainline

Page 113: Real World Git Workflows - EclipseCon Europe 2013

Don’t fear the Merge! Use it!4

May rebase feature branches5

Recommendation?

git log --first-parent

Explicit merges into the mainline

Page 114: Real World Git Workflows - EclipseCon Europe 2013

Don’t fear the Merge! Use it!4

May rebase feature branches5

Recommendation?

git log --first-parent

To update the feature branch

Explicit merges into the mainline

Page 115: Real World Git Workflows - EclipseCon Europe 2013

Don’t fear the Merge! Use it!4

May rebase feature branches5

Recommendation?

git log --first-parent

To update the feature branch

Explicit merges into the mainline

After review!

Page 116: Real World Git Workflows - EclipseCon Europe 2013

Don’t fear the Merge! Use it!4

May rebase feature branches

Work with the tool!

5

6

Recommendation?

git log --first-parent

To update the feature branch

Explicit merges into the mainline

After review!

Page 117: Real World Git Workflows - EclipseCon Europe 2013

Don’t fear the Merge! Use it!4

May rebase feature branches

Work with the tool!

5

6

Recommendation?

git log --first-parent

Trying to strive for a linearized history is less useful than you think

To update the feature branch

Explicit merges into the mainline

After review!

Page 118: Real World Git Workflows - EclipseCon Europe 2013

Single Repositoryvs

Remote Forks

Page 119: Real World Git Workflows - EclipseCon Europe 2013

Every one has their remote repository

With Forks

Page 120: Real World Git Workflows - EclipseCon Europe 2013

Every one has their remote repository

With Forks

Full remote copy,each has one Integrator, Gatekeeper,

Tech Lead, etc.

Page 121: Real World Git Workflows - EclipseCon Europe 2013

Pros of a Single Repo

Page 122: Real World Git Workflows - EclipseCon Europe 2013

Complete visibility1

Pros of a Single Repo

Page 123: Real World Git Workflows - EclipseCon Europe 2013

Complete visibility1

Pros of a Single RepoAll feature branches available

Page 124: Real World Git Workflows - EclipseCon Europe 2013

Complete visibility1

No per Dev remotes required2

Pros of a Single RepoAll feature branches available

Page 125: Real World Git Workflows - EclipseCon Europe 2013

Complete visibility1

No per Dev remotes required

KISS

2

3

Pros of a Single RepoAll feature branches available

Page 126: Real World Git Workflows - EclipseCon Europe 2013

Forks Are Great too BTW

Page 127: Real World Git Workflows - EclipseCon Europe 2013

FORKING IN THE

ENTERPRISE

Page 128: Real World Git Workflows - EclipseCon Europe 2013
Page 129: Real World Git Workflows - EclipseCon Europe 2013

FORKING IN

ENTERPRISE5 Reasons for...

Page 130: Real World Git Workflows - EclipseCon Europe 2013

FORKING IN

ENTERPRISE

REASON 1

Great for customizing libraries

Page 131: Real World Git Workflows - EclipseCon Europe 2013

FORKING IN

ENTERPRISE

REASON 1

Great for customizing librariesand still get bug fixes

Page 132: Real World Git Workflows - EclipseCon Europe 2013

REASON 2

Great for innovation spikes

FORKING IN

ENTERPRISE

Page 133: Real World Git Workflows - EclipseCon Europe 2013

REASON 2

Great for innovation spikesand maybe add it later

FORKING IN

ENTERPRISE

Page 134: Real World Git Workflows - EclipseCon Europe 2013

REASON 3

Protecting your components

FORKING IN

ENTERPRISE

Page 135: Real World Git Workflows - EclipseCon Europe 2013

REASON 3

Protecting your components

but still be open for changes

FORKING IN

ENTERPRISE

Page 136: Real World Git Workflows - EclipseCon Europe 2013

REASON 4

Reduce the noise

FORKING IN

ENTERPRISE

Page 137: Real World Git Workflows - EclipseCon Europe 2013

REASON 4

Reduce the noise

and keep the overview for huge projects

FORKING IN

ENTERPRISE

Page 138: Real World Git Workflows - EclipseCon Europe 2013

REASON 5

Interaction with Contractors & Interns

FORKING IN

ENTERPRISE

Page 139: Real World Git Workflows - EclipseCon Europe 2013

REASON 5

Interaction with Contractors & Interns

protect your sources

FORKING IN

ENTERPRISE

Page 140: Real World Git Workflows - EclipseCon Europe 2013

Tooling & Automation

Page 141: Real World Git Workflows - EclipseCon Europe 2013

Tooling & Automation3

Page 142: Real World Git Workflows - EclipseCon Europe 2013

Hooks

Page 143: Real World Git Workflows - EclipseCon Europe 2013

Hooks are little scripts you can place in

the `$GIT_DIR/hooks` directory to trigger

action at certain points.

– githooks Documentation

”“

Page 144: Real World Git Workflows - EclipseCon Europe 2013

Pre Post

Page 145: Real World Git Workflows - EclipseCon Europe 2013

Local Remote

Page 146: Real World Git Workflows - EclipseCon Europe 2013

Local Remotepre-receiveupdatepost-receivepost-update

pre-/post-applypatchpre-/post-commit

pre-rebasepost-checkout

post-mergepre-push

Page 147: Real World Git Workflows - EclipseCon Europe 2013

Code Quality via pre-commit hooks

Page 148: Real World Git Workflows - EclipseCon Europe 2013

.git/hooks/pre-commit

Page 149: Real World Git Workflows - EclipseCon Europe 2013

git add -ugit commit -m "TEST checkstyle"

Page 150: Real World Git Workflows - EclipseCon Europe 2013

Starting audit...

/Users/user/[...]/com/atlassian/stash/web/projects/ProjectController.java:161:12: 'for' is not followed by whitespace.

Audit done.Commit aborted.

Page 151: Real World Git Workflows - EclipseCon Europe 2013

Branch from green builds

Page 152: Real World Git Workflows - EclipseCon Europe 2013

.git/hooks/post-checkout

Page 153: Real World Git Workflows - EclipseCon Europe 2013

$ git checkout mastermaster is lookin'good! c4f3b4b has 4 green builds. $ git checkout stable-2.3 DANGER! stable-2.3 is busted. e1324fa has 2 red builds.

Page 154: Real World Git Workflows - EclipseCon Europe 2013

Get it at: bitly.com/green-builds

Page 155: Real World Git Workflows - EclipseCon Europe 2013

What happens to CI with ?

Page 156: Real World Git Workflows - EclipseCon Europe 2013

4 What happens to CI with ?

Page 157: Real World Git Workflows - EclipseCon Europe 2013
Page 158: Real World Git Workflows - EclipseCon Europe 2013

What happens to CI with git?1

Page 159: Real World Git Workflows - EclipseCon Europe 2013

What happens to CI with git?1

An explosion of branches2

Page 160: Real World Git Workflows - EclipseCon Europe 2013

What happens to CI with git?1

An explosion of branches2

3 Performance degradation of build sys

Page 161: Real World Git Workflows - EclipseCon Europe 2013
Page 162: Real World Git Workflows - EclipseCon Europe 2013

Building everything is expensive1

Page 163: Real World Git Workflows - EclipseCon Europe 2013

Building everything is expensive1

Automatically build stable and master2

Page 164: Real World Git Workflows - EclipseCon Europe 2013

Building everything is expensive1

Automatically build stable and master2

3 Manually trigger feature branch builds

Page 165: Real World Git Workflows - EclipseCon Europe 2013

In Conclusion: the recipe

Page 166: Real World Git Workflows - EclipseCon Europe 2013

BranchingModel

Practices & Decisions

Automation & CI setup

ConclusionsCollaboration

Model

Page 167: Real World Git Workflows - EclipseCon Europe 2013

BranchingModel

Practices & Decisions

Automation & CI setup

ConclusionsCollaboration

Model

Centralized

Page 168: Real World Git Workflows - EclipseCon Europe 2013

BranchingModel

Practices & Decisions

Automation & CI setup

Conclusions

Product workflow

CollaborationModel

Centralized

Page 169: Real World Git Workflows - EclipseCon Europe 2013

BranchingModel

Practices & Decisions

Automation & CI setup

Conclusions

Product workflow

Continuous delivery workflow

CollaborationModel

Centralized

Page 170: Real World Git Workflows - EclipseCon Europe 2013

BranchingModel

Practices & Decisions

Automation & CI setup

Conclusions

Product workflow

Continuous delivery workflow

Embrace PR

CollaborationModel

Centralized

Page 171: Real World Git Workflows - EclipseCon Europe 2013

BranchingModel

Practices & Decisions

Automation & CI setup

Conclusions

Product workflow

Continuous delivery workflow

Embrace PR

CollaborationModel

Centralized Merge vs Rebase

Page 172: Real World Git Workflows - EclipseCon Europe 2013

BranchingModel

Practices & Decisions

Automation & CI setup

Conclusions

Product workflow

Continuous delivery workflow

Embrace PR

Single Repo or Forks

CollaborationModel

Centralized Merge vs Rebase

Page 173: Real World Git Workflows - EclipseCon Europe 2013

BranchingModel

Practices & Decisions

Automation & CI setup

Conclusions

Product workflow

Continuous delivery workflow

Embrace PR

Single Repo or Forks

CollaborationModel

Centralized

Hooks, hooks everywhere

Merge vs Rebase

Page 174: Real World Git Workflows - EclipseCon Europe 2013

BranchingModel

Practices & Decisions

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

Merge vs Rebase

Page 175: Real World Git Workflows - EclipseCon Europe 2013

Nicola PaolucciTHANK YOU FOR YOUR ATTENTION!

@durdndurdn.comShould I change the pic? ;-)

Page 176: Real World Git Workflows - EclipseCon Europe 2013

Git Repository Management for Enterprise Teams

Free Git Code Hosting for Small Teams

Free Git Desktop client for Mac or Windows

Atlassian