intro to gitflow

39
AE Git Training or, "Octopus merge will save your soul"

Upload: ben-speakmon

Post on 07-Dec-2014

110 views

Category:

Software


0 download

DESCRIPTION

Presentation from late 2013 introducing Git and Gitflow to my team.

TRANSCRIPT

Page 1: Intro to Gitflow

AE Git Trainingor, "Octopus merge will save your soul"

Page 2: Intro to Gitflow

Agenda

Why Git

What Git is

Differences from Subversion

Workflow Training

Page 3: Intro to Gitflow

We have a problem.

Page 4: Intro to Gitflow

Code quality isn't great.

Page 5: Intro to Gitflow

And releases are really hard.

Page 6: Intro to Gitflow

And we can't do Kanban effectively.

Page 7: Intro to Gitflow

And too much code goes without review.

Page 8: Intro to Gitflow

...

Page 9: Intro to Gitflow

well, we have several problems.

Page 10: Intro to Gitflow

Would a new workflow solve these problems?

Page 11: Intro to Gitflow
Page 12: Intro to Gitflow

We've built a new workflow on Git.

Page 13: Intro to Gitflow

We'll go over it all in a sec, but...

Page 14: Intro to Gitflow

We get a lot of benefits!

Seamless releases (and rollbacks!)

Safe, predictable, reliable feature flow

More efficient QA

Freedom to experiment

Better tools

Page 15: Intro to Gitflow

Git Concepts

Page 16: Intro to Gitflow

Git is source control.

Manage history and changes of source tree, just like Subversion

Open source

Widely used

Bewilderingly powerful and flexible

Page 17: Intro to Gitflow

Git is about branches.

Everything is a branch

Merge one, two or many branches at once

Any branch can be authoritative

Take only the parts of a branch you want

Page 18: Intro to Gitflow

Git makes you independent.

A Git server is a role, not a position

Every Git user can be a server

Everybody has the complete history

Do whatever you want without affecting others

Fault-tolerant: if one client fails, the rest are unaffected

Page 19: Intro to Gitflow

Git/SVN differences

Page 20: Intro to Gitflow

Git changes - Commits

All Git commits are local only

Saving your work (commit) and sending it to the server (pushing) are different operations

svn commit == git commit && git push

Page 21: Intro to Gitflow

Git changes - Branches

Branches are like commits -- local only unless/until pushed to a server

Branches are not commits

Once merged, a branch can (and usually should) be deleted

Branches are dirt cheap -- always use them

Page 22: Intro to Gitflow

Git awesome: Stash

Not Stash the server, though that also rules

Stash is a clipboard with history for your changes

Save your uncommitted changes, then switch branches or revert to fresh

Once you use it, you'll wonder how you ever lived without it

Page 23: Intro to Gitflow

AE Workflow

Page 24: Intro to Gitflow
Page 25: Intro to Gitflow

Historical Branches

Page 26: Intro to Gitflow

Two permanent branches: master, develop

master is always releaseable and commits to it are always tagged

develop is the integration point for new features and the base for CI

Page 27: Intro to Gitflow

Owned by QA and team leads

Only they can merge to these branches

Preserve the history of the project

Deployer operates from master

Page 28: Intro to Gitflow

Feature branches

Page 29: Intro to Gitflow

Feature branches implement new work

Always branched from develop

Made by developers

Page 30: Intro to Gitflow

Some feature branches are abandoned

Others will merge into develop

Merges happen through pull requests and are contingent on passing code review / QA, and then are deleted

Page 31: Intro to Gitflow

Release branches

Page 32: Intro to Gitflow

Created from develop by QA or team lead

Integrate QA'd and reviewed code into release

Plus any last-minute fixes or documentation

Page 33: Intro to Gitflow

After merge to master, tagged with version for rollback

Also merged into develop so fixes are not lost, then deleted

Page 34: Intro to Gitflow

Hotfix branches

Page 35: Intro to Gitflow

For emergency fixes in production

Branched from master

Merged back into master, but also into develop so fixes aren't lost

Page 36: Intro to Gitflow

Must pass code review and QA, so also merged with pull requests

Perfect for Kanban fixes as well

Page 37: Intro to Gitflow

Detailed instructions, including how to use Stash and SourceTree, are on the wiki

It's a big change; ask questions and read the docs!

Ask me, Kevin or Andrew for help if you get stuck

Last words

Page 38: Intro to Gitflow

That's it!

Git is awesome

Git will make you awesomer

New workflow makes for better code

All is happiness

Page 39: Intro to Gitflow

Pose puny questions.