nerds — 28 may 2015 - · pdf filenerds — 28 may 2015 how to git better using git...

44
NERDS — 28 May 2015 How to Git Better Using Git Workflows (with some help from Atlasssian)

Upload: truongkhue

Post on 10-Feb-2018

223 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: NERDS — 28 May 2015 - · PDF fileNERDS — 28 May 2015 How to Git Better Using Git Workflows (with some help from Atlasssian) Why should we Git Better? ... Git Flow: Hotfix Branches

NERDS — 28 May 2015

How to Git Better Using Git Workflows (with some help from Atlasssian)

Page 2: NERDS — 28 May 2015 - · PDF fileNERDS — 28 May 2015 How to Git Better Using Git Workflows (with some help from Atlasssian) Why should we Git Better? ... Git Flow: Hotfix Branches

Why should we Git Better?

❖ Software Craftsmanship ❖ You are as proficient as you are

familiar with your tools ❖ You are more likely to cut

yourself with a dull knife than a sharp one

Page 3: NERDS — 28 May 2015 - · PDF fileNERDS — 28 May 2015 How to Git Better Using Git Workflows (with some help from Atlasssian) Why should we Git Better? ... Git Flow: Hotfix Branches

Fair Warning: Fancy Git Talk aHEAD

❖ Requires decent understanding of Git branches ❖ Lots of Pictures

❖ Available “Git up to Speed” Brown Bag (before 22 June)

Page 4: NERDS — 28 May 2015 - · PDF fileNERDS — 28 May 2015 How to Git Better Using Git Workflows (with some help from Atlasssian) Why should we Git Better? ... Git Flow: Hotfix Branches

NEWSFLASH! Git is not Version Control!

❖ You: Umm… so what is it then? ❖ Git is a set of tools that provides a workflow for your

version control.

❖ You: Umm… and that means what exactly? ❖ Use Git to customize your team’s way of using version

control in your daily development.

Page 5: NERDS — 28 May 2015 - · PDF fileNERDS — 28 May 2015 How to Git Better Using Git Workflows (with some help from Atlasssian) Why should we Git Better? ... Git Flow: Hotfix Branches

MIND = BLOWN

Page 6: NERDS — 28 May 2015 - · PDF fileNERDS — 28 May 2015 How to Git Better Using Git Workflows (with some help from Atlasssian) Why should we Git Better? ... Git Flow: Hotfix Branches

MIND = BLOWN

Page 7: NERDS — 28 May 2015 - · PDF fileNERDS — 28 May 2015 How to Git Better Using Git Workflows (with some help from Atlasssian) Why should we Git Better? ... Git Flow: Hotfix Branches

Popular Workflows for Git

❖ This is well treaded territory… in industry ❖ Documented in Confluence on DEVLAN

1. Centralized

2. Feature Branch

3. Git Flow

4. Forking

Page 8: NERDS — 28 May 2015 - · PDF fileNERDS — 28 May 2015 How to Git Better Using Git Workflows (with some help from Atlasssian) Why should we Git Better? ... Git Flow: Hotfix Branches

Popular Workflows for Git

❖ This is well treaded territory… in industry ❖ Documented in Confluence on DEVLAN

1. Centralized

2. Feature Branch

3. Git Flow

4. Forking (see Confluence)

Page 9: NERDS — 28 May 2015 - · PDF fileNERDS — 28 May 2015 How to Git Better Using Git Workflows (with some help from Atlasssian) Why should we Git Better? ... Git Flow: Hotfix Branches

Centralized (and why it’s bad)

Page 10: NERDS — 28 May 2015 - · PDF fileNERDS — 28 May 2015 How to Git Better Using Git Workflows (with some help from Atlasssian) Why should we Git Better? ... Git Flow: Hotfix Branches

Centralized (and why it’s bad)

Page 11: NERDS — 28 May 2015 - · PDF fileNERDS — 28 May 2015 How to Git Better Using Git Workflows (with some help from Atlasssian) Why should we Git Better? ... Git Flow: Hotfix Branches

Centralized (and why it’s bad)

Page 12: NERDS — 28 May 2015 - · PDF fileNERDS — 28 May 2015 How to Git Better Using Git Workflows (with some help from Atlasssian) Why should we Git Better? ... Git Flow: Hotfix Branches

Typical Git 3-Way Merge

Page 13: NERDS — 28 May 2015 - · PDF fileNERDS — 28 May 2015 How to Git Better Using Git Workflows (with some help from Atlasssian) Why should we Git Better? ... Git Flow: Hotfix Branches

Typical Git 3-Way Merge

Page 14: NERDS — 28 May 2015 - · PDF fileNERDS — 28 May 2015 How to Git Better Using Git Workflows (with some help from Atlasssian) Why should we Git Better? ... Git Flow: Hotfix Branches

Centralized (and why it’s bad)

❖ Everyone for themselves! ❖ Errors compounded ❖ Knowledge partitioning ❖ Clear history… ❖ Lack of project organization ❖ No efforts to improve quality built

into workflow

Page 15: NERDS — 28 May 2015 - · PDF fileNERDS — 28 May 2015 How to Git Better Using Git Workflows (with some help from Atlasssian) Why should we Git Better? ... Git Flow: Hotfix Branches

Solution: Modify Workflow

Page 16: NERDS — 28 May 2015 - · PDF fileNERDS — 28 May 2015 How to Git Better Using Git Workflows (with some help from Atlasssian) Why should we Git Better? ... Git Flow: Hotfix Branches

Solution: Modify Workflow

❖ Keep master clean! ❖ No direct commits ❖ No broken builds ❖ No partial features ❖ Merges only

Page 17: NERDS — 28 May 2015 - · PDF fileNERDS — 28 May 2015 How to Git Better Using Git Workflows (with some help from Atlasssian) Why should we Git Better? ... Git Flow: Hotfix Branches

Solution: Modify Workflow

❖ Keep master clean! ❖ No direct commits ❖ No broken builds ❖ No partial features ❖ Merges only

❖ Code Review of changes by team before merge

Page 18: NERDS — 28 May 2015 - · PDF fileNERDS — 28 May 2015 How to Git Better Using Git Workflows (with some help from Atlasssian) Why should we Git Better? ... Git Flow: Hotfix Branches

Solution: Modify Workflow

❖ Keep master clean! ❖ No direct commits ❖ No broken builds ❖ No partial features ❖ Merges only

❖ Code Review of changes by team before merge

❖ Clear history

Page 19: NERDS — 28 May 2015 - · PDF fileNERDS — 28 May 2015 How to Git Better Using Git Workflows (with some help from Atlasssian) Why should we Git Better? ... Git Flow: Hotfix Branches

Solution: Modify Workflow

❖ Keep master clean! ❖ No direct commits ❖ No broken builds ❖ No partial features ❖ Merges only

❖ Code Review of changes by team before merge

❖ Clear history❖ Clear improvements to quality

Page 20: NERDS — 28 May 2015 - · PDF fileNERDS — 28 May 2015 How to Git Better Using Git Workflows (with some help from Atlasssian) Why should we Git Better? ... Git Flow: Hotfix Branches

Feature Branching - A Branch Per Feature

Page 21: NERDS — 28 May 2015 - · PDF fileNERDS — 28 May 2015 How to Git Better Using Git Workflows (with some help from Atlasssian) Why should we Git Better? ... Git Flow: Hotfix Branches

Feature Branching - A Branch Per Feature

Page 22: NERDS — 28 May 2015 - · PDF fileNERDS — 28 May 2015 How to Git Better Using Git Workflows (with some help from Atlasssian) Why should we Git Better? ... Git Flow: Hotfix Branches

Feature Branching - Pull Requests

Page 23: NERDS — 28 May 2015 - · PDF fileNERDS — 28 May 2015 How to Git Better Using Git Workflows (with some help from Atlasssian) Why should we Git Better? ... Git Flow: Hotfix Branches

Feature Branching - Pull Requests

Page 24: NERDS — 28 May 2015 - · PDF fileNERDS — 28 May 2015 How to Git Better Using Git Workflows (with some help from Atlasssian) Why should we Git Better? ... Git Flow: Hotfix Branches

Feature Branching - Pull Requests

Page 25: NERDS — 28 May 2015 - · PDF fileNERDS — 28 May 2015 How to Git Better Using Git Workflows (with some help from Atlasssian) Why should we Git Better? ... Git Flow: Hotfix Branches

Feature Branching - Pull Requests

Page 26: NERDS — 28 May 2015 - · PDF fileNERDS — 28 May 2015 How to Git Better Using Git Workflows (with some help from Atlasssian) Why should we Git Better? ... Git Flow: Hotfix Branches

Feature Branching - Pull Requests

Page 27: NERDS — 28 May 2015 - · PDF fileNERDS — 28 May 2015 How to Git Better Using Git Workflows (with some help from Atlasssian) Why should we Git Better? ... Git Flow: Hotfix Branches

Feature Branching - Pull Requests

Page 28: NERDS — 28 May 2015 - · PDF fileNERDS — 28 May 2015 How to Git Better Using Git Workflows (with some help from Atlasssian) Why should we Git Better? ... Git Flow: Hotfix Branches

Feature Branching

❖ Pull Requests give us: ❖ A stable master branch protected from chaos ❖ Digestible pieces of Code Review ❖ Knowledge sharing / Collective code ownership ❖ Clear history of changes ❖ Clear improvements made

❖ But how about long term projects?

Page 29: NERDS — 28 May 2015 - · PDF fileNERDS — 28 May 2015 How to Git Better Using Git Workflows (with some help from Atlasssian) Why should we Git Better? ... Git Flow: Hotfix Branches

Git Flow, or How I Became OCD about DVCS

Page 30: NERDS — 28 May 2015 - · PDF fileNERDS — 28 May 2015 How to Git Better Using Git Workflows (with some help from Atlasssian) Why should we Git Better? ... Git Flow: Hotfix Branches

Git Flow: Historical Branches

❖ master contains stable delivered versions only ❖ develop is for stable incorporation of new features

Page 31: NERDS — 28 May 2015 - · PDF fileNERDS — 28 May 2015 How to Git Better Using Git Workflows (with some help from Atlasssian) Why should we Git Better? ... Git Flow: Hotfix Branches

Git Flow: Historical Branches

❖ master contains stable delivered versions only ❖ develop is for stable incorporation of new features

Page 32: NERDS — 28 May 2015 - · PDF fileNERDS — 28 May 2015 How to Git Better Using Git Workflows (with some help from Atlasssian) Why should we Git Better? ... Git Flow: Hotfix Branches

Git Flow: Feature Branches

❖ New features incorporated (by feature branching!) into develop

Page 33: NERDS — 28 May 2015 - · PDF fileNERDS — 28 May 2015 How to Git Better Using Git Workflows (with some help from Atlasssian) Why should we Git Better? ... Git Flow: Hotfix Branches

Git Flow: Feature Branches

❖ Branch from develop ❖ Pull Request to merge into develop

Page 34: NERDS — 28 May 2015 - · PDF fileNERDS — 28 May 2015 How to Git Better Using Git Workflows (with some help from Atlasssian) Why should we Git Better? ... Git Flow: Hotfix Branches

Git Flow: Feature Branches

❖ Branch from develop ❖ Pull Request to merge into develop

Page 35: NERDS — 28 May 2015 - · PDF fileNERDS — 28 May 2015 How to Git Better Using Git Workflows (with some help from Atlasssian) Why should we Git Better? ... Git Flow: Hotfix Branches

Git Flow: Release Branches

❖ Release candidates executed in separate release branch ❖ No new features — only fixes

Page 36: NERDS — 28 May 2015 - · PDF fileNERDS — 28 May 2015 How to Git Better Using Git Workflows (with some help from Atlasssian) Why should we Git Better? ... Git Flow: Hotfix Branches

Git Flow: Release Branches

❖ Release candidates executed in separate release branch ❖ No new features — only fixes

Page 37: NERDS — 28 May 2015 - · PDF fileNERDS — 28 May 2015 How to Git Better Using Git Workflows (with some help from Atlasssian) Why should we Git Better? ... Git Flow: Hotfix Branches

Git Flow: Release Branches

❖ Release candidates executed in separate release branch ❖ No new features — only fixes

Page 38: NERDS — 28 May 2015 - · PDF fileNERDS — 28 May 2015 How to Git Better Using Git Workflows (with some help from Atlasssian) Why should we Git Better? ... Git Flow: Hotfix Branches

Git Flow: Release Branches

❖ Release candidates executed in separate release branch ❖ No new features — only fixes

Page 39: NERDS — 28 May 2015 - · PDF fileNERDS — 28 May 2015 How to Git Better Using Git Workflows (with some help from Atlasssian) Why should we Git Better? ... Git Flow: Hotfix Branches

Git Flow: Hotfix Branches

❖ Branch for applying hotfixes (perfect for Discrepancy Reports) ❖ Merge into master and develop

1.0 1.0.1

Page 40: NERDS — 28 May 2015 - · PDF fileNERDS — 28 May 2015 How to Git Better Using Git Workflows (with some help from Atlasssian) Why should we Git Better? ... Git Flow: Hotfix Branches

Git Flow: Hotfix Branches

❖ Branch for applying hotfixes (perfect for Discrepancy Reports) ❖ Merge into master and develop

1.0 1.0.1

Page 41: NERDS — 28 May 2015 - · PDF fileNERDS — 28 May 2015 How to Git Better Using Git Workflows (with some help from Atlasssian) Why should we Git Better? ... Git Flow: Hotfix Branches

How Atlasssian Helps

❖ Track all issues in Jira ❖ Create feature branch

from each Jira issue

Page 42: NERDS — 28 May 2015 - · PDF fileNERDS — 28 May 2015 How to Git Better Using Git Workflows (with some help from Atlasssian) Why should we Git Better? ... Git Flow: Hotfix Branches

How Atlasssian Helps

❖ Track all issues in Jira ❖ Create feature branch

from each Jira issue ❖ Merge feature branch in

Stash using Pull Requests

Page 43: NERDS — 28 May 2015 - · PDF fileNERDS — 28 May 2015 How to Git Better Using Git Workflows (with some help from Atlasssian) Why should we Git Better? ... Git Flow: Hotfix Branches

Questions?

Page 44: NERDS — 28 May 2015 - · PDF fileNERDS — 28 May 2015 How to Git Better Using Git Workflows (with some help from Atlasssian) Why should we Git Better? ... Git Flow: Hotfix Branches

Questions?

GO FORTH AND ROCK