+ All Categories
Home > Technology > Git Flow

Git Flow

Date post: 06-May-2015
Category:
Upload: fernando-fernandes
View: 612 times
Download: 1 times
Share this document with a friend
Popular Tags:
148
GIT Flow facebook.com/mfernandes.fernando Friday, August 10, 12
Transcript
Page 1: Git Flow

GIT Flowfacebook.com/mfernandes.fernando

Friday, August 10, 12

Page 2: Git Flow

Why GIT?

Friday, August 10, 12

Page 3: Git Flow

Why GIT?• Distributed

Friday, August 10, 12

Page 4: Git Flow

Why GIT?• Distributed

• A clone of the *entire* repository (history, tags) in each dev machine

Friday, August 10, 12

Page 5: Git Flow

Why GIT?• Distributed

• A clone of the *entire* repository (history, tags) in each dev machine

• Code on the road! You are the repository. Multiple backups.

Friday, August 10, 12

Page 6: Git Flow

Why GIT?• Distributed

• A clone of the *entire* repository (history, tags) in each dev machine

• Code on the road! You are the repository. Multiple backups.

• Branching model

Friday, August 10, 12

Page 7: Git Flow

Why GIT?• Distributed

• A clone of the *entire* repository (history, tags) in each dev machine

• Code on the road! You are the repository. Multiple backups.

• Branching model

• Easy: git checkout -b <someFeature>

Friday, August 10, 12

Page 8: Git Flow

Why GIT?• Distributed

• A clone of the *entire* repository (history, tags) in each dev machine

• Code on the road! You are the repository. Multiple backups.

• Branching model

• Easy: git checkout -b <someFeature>

• Convenient: Create, try out an idea, commit, switch back, merge or discard.

Friday, August 10, 12

Page 9: Git Flow

Why GIT?• Distributed

• A clone of the *entire* repository (history, tags) in each dev machine

• Code on the road! You are the repository. Multiple backups.

• Branching model

• Easy: git checkout -b <someFeature>

• Convenient: Create, try out an idea, commit, switch back, merge or discard.

• Small and Fast

Friday, August 10, 12

Page 10: Git Flow

Why GIT?• Distributed

• A clone of the *entire* repository (history, tags) in each dev machine

• Code on the road! You are the repository. Multiple backups.

• Branching model

• Easy: git checkout -b <someFeature>

• Convenient: Create, try out an idea, commit, switch back, merge or discard.

• Small and Fast

• Written in C (which reduces runtime overhead associated with high-level languages)

Friday, August 10, 12

Page 11: Git Flow

Why GIT?• Distributed

• A clone of the *entire* repository (history, tags) in each dev machine

• Code on the road! You are the repository. Multiple backups.

• Branching model

• Easy: git checkout -b <someFeature>

• Convenient: Create, try out an idea, commit, switch back, merge or discard.

• Small and Fast

• Written in C (which reduces runtime overhead associated with high-level languages)

• Built to work on the Linux kernel (it has had to effectively handle large repositories from day one)

Friday, August 10, 12

Page 12: Git Flow

Benchmarks

Friday, August 10, 12

Page 13: Git Flow

Benchmarks

Friday, August 10, 12

Page 14: Git Flow

Benchmarks

Friday, August 10, 12

Page 15: Git Flow

Benchmarks

Friday, August 10, 12

Page 16: Git Flow

Benchmarks

Friday, August 10, 12

Page 17: Git Flow

Benchmarks

Friday, August 10, 12

Page 18: Git Flow

Benchmarks

Friday, August 10, 12

Page 19: Git Flow

Benchmarks

Friday, August 10, 12

Page 20: Git Flow

Staging (or index) Area

Friday, August 10, 12

Page 21: Git Flow

Staging (or index) Area

Friday, August 10, 12

Page 22: Git Flow

Staging (or index) Area

Friday, August 10, 12

Page 23: Git Flow

Free and Open Source

Friday, August 10, 12

Page 24: Git Flow

Free and Open Source

• GPLv2

Friday, August 10, 12

Page 25: Git Flow

Free and Open Source

• GPLv2

• Free, forever

Friday, August 10, 12

Page 26: Git Flow

Free and Open Source

• GPLv2

• Free, forever

• Download, inspect and modify GIT source

Friday, August 10, 12

Page 27: Git Flow

Workflows

Friday, August 10, 12

Page 28: Git Flow

Workflows

• getBestWorkflow()

Friday, August 10, 12

Page 29: Git Flow

Workflows

• getBestWorkflow()

• NPE

Friday, August 10, 12

Page 30: Git Flow

Workflows

• getBestWorkflow()

• NPE

• ANY!

Friday, August 10, 12

Page 31: Git Flow

Subversion-Style

Friday, August 10, 12

Page 32: Git Flow

Subversion-Style

Friday, August 10, 12

Page 33: Git Flow

Integration Manager

Friday, August 10, 12

Page 34: Git Flow

Integration Manager

Friday, August 10, 12

Page 35: Git Flow

Dictator and Lieutenants

Friday, August 10, 12

Page 36: Git Flow

Dictator and Lieutenants

Friday, August 10, 12

Page 37: Git Flow

gitflow

Friday, August 10, 12

Page 38: Git Flow

gitflow• GIT abstraction

Friday, August 10, 12

Page 39: Git Flow

gitflow• GIT abstraction

• Just a bunch of scripts

Friday, August 10, 12

Page 40: Git Flow

gitflow• GIT abstraction

• Just a bunch of scripts

• Greatly inspired by existing models

Friday, August 10, 12

Page 41: Git Flow

gitflow• GIT abstraction

• Just a bunch of scripts

• Greatly inspired by existing models

• Main branches:

Friday, August 10, 12

Page 42: Git Flow

gitflow• GIT abstraction

• Just a bunch of scripts

• Greatly inspired by existing models

• Main branches:

• master

Friday, August 10, 12

Page 43: Git Flow

gitflow• GIT abstraction

• Just a bunch of scripts

• Greatly inspired by existing models

• Main branches:

• master

• develop

Friday, August 10, 12

Page 44: Git Flow

gitflow• GIT abstraction

• Just a bunch of scripts

• Greatly inspired by existing models

• Main branches:

• master

• develop

• Support branches:

Friday, August 10, 12

Page 45: Git Flow

gitflow• GIT abstraction

• Just a bunch of scripts

• Greatly inspired by existing models

• Main branches:

• master

• develop

• Support branches:

• feature

Friday, August 10, 12

Page 46: Git Flow

gitflow• GIT abstraction

• Just a bunch of scripts

• Greatly inspired by existing models

• Main branches:

• master

• develop

• Support branches:

• feature

• release

Friday, August 10, 12

Page 47: Git Flow

gitflow• GIT abstraction

• Just a bunch of scripts

• Greatly inspired by existing models

• Main branches:

• master

• develop

• Support branches:

• feature

• release

• hotfix

Friday, August 10, 12

Page 48: Git Flow

gitflowThe BIG picture

Friday, August 10, 12

Page 49: Git Flow

gitflowThe BIG picture

Friday, August 10, 12

Page 50: Git Flow

gitflow: Main branches

Friday, August 10, 12

Page 51: Git Flow

gitflow: Main branches

Friday, August 10, 12

Page 52: Git Flow

gitflow: Main branches• origin/master is

where the source code of HEAD always reflects a production-ready state.

Friday, August 10, 12

Page 53: Git Flow

gitflow: Main branches• origin/master is

where the source code of HEAD always reflects a production-ready state.

• origin/develop is where the source code of HEAD always reflects a state with the latest delivered development changes for the next release.

Friday, August 10, 12

Page 54: Git Flow

gitflow: Supporting branches - FEATURE

Friday, August 10, 12

Page 55: Git Flow

gitflow: Supporting branches - FEATURE

Friday, August 10, 12

Page 56: Git Flow

gitflow: Supporting branches - FEATURE

• Definition: used to develop new features for the upcoming or a distant future release.

Friday, August 10, 12

Page 57: Git Flow

gitflow: Supporting branches - FEATURE

• Definition: used to develop new features for the upcoming or a distant future release.

• Tipically exist in developer repos only, NOT IN ORIGIN

Friday, August 10, 12

Page 58: Git Flow

gitflow: Supporting branches - FEATURE

• Definition: used to develop new features for the upcoming or a distant future release.

• Tipically exist in developer repos only, NOT IN ORIGIN

• Branch off from: DEVELOP

Friday, August 10, 12

Page 59: Git Flow

gitflow: Supporting branches - FEATURE

• Definition: used to develop new features for the upcoming or a distant future release.

• Tipically exist in developer repos only, NOT IN ORIGIN

• Branch off from: DEVELOP

• Must merge back into: DEVELOP

Friday, August 10, 12

Page 60: Git Flow

gitflow: Supporting branches - FEATURE

• Definition: used to develop new features for the upcoming or a distant future release.

• Tipically exist in developer repos only, NOT IN ORIGIN

• Branch off from: DEVELOP

• Must merge back into: DEVELOP

• Branch naming convention:

Friday, August 10, 12

Page 61: Git Flow

gitflow: Supporting branches - FEATURE

• Definition: used to develop new features for the upcoming or a distant future release.

• Tipically exist in developer repos only, NOT IN ORIGIN

• Branch off from: DEVELOP

• Must merge back into: DEVELOP

• Branch naming convention:

• <devName>-* (fernando-gallery)

Friday, August 10, 12

Page 62: Git Flow

gitflow: Supporting branches - FEATURE

• Definition: used to develop new features for the upcoming or a distant future release.

• Tipically exist in developer repos only, NOT IN ORIGIN

• Branch off from: DEVELOP

• Must merge back into: DEVELOP

• Branch naming convention:

• <devName>-* (fernando-gallery)

• (!) Not allowed: master, develop, release-* or hotfix-*

Friday, August 10, 12

Page 63: Git Flow

gitflow: Supporting branches - RELEASE

Friday, August 10, 12

Page 64: Git Flow

gitflow: Supporting branches - RELEASE

Friday, August 10, 12

Page 65: Git Flow

gitflow: Supporting branches - RELEASE• Definition: support preparation of a new

production release. Allow for MINOR bug fixes and preparing meta-data for a release (version number, build dates, etc.)

Friday, August 10, 12

Page 66: Git Flow

gitflow: Supporting branches - RELEASE• Definition: support preparation of a new

production release. Allow for MINOR bug fixes and preparing meta-data for a release (version number, build dates, etc.)

• When? develop (almost) reflect the desired state of the new release. All planned features were implemented.

Friday, August 10, 12

Page 67: Git Flow

gitflow: Supporting branches - RELEASE• Definition: support preparation of a new

production release. Allow for MINOR bug fixes and preparing meta-data for a release (version number, build dates, etc.)

• When? develop (almost) reflect the desired state of the new release. All planned features were implemented.

• Branch off from: DEVELOP

Friday, August 10, 12

Page 68: Git Flow

gitflow: Supporting branches - RELEASE• Definition: support preparation of a new

production release. Allow for MINOR bug fixes and preparing meta-data for a release (version number, build dates, etc.)

• When? develop (almost) reflect the desired state of the new release. All planned features were implemented.

• Branch off from: DEVELOP

• Must merge back into: DEVELOP and MASTER

Friday, August 10, 12

Page 69: Git Flow

gitflow: Supporting branches - RELEASE• Definition: support preparation of a new

production release. Allow for MINOR bug fixes and preparing meta-data for a release (version number, build dates, etc.)

• When? develop (almost) reflect the desired state of the new release. All planned features were implemented.

• Branch off from: DEVELOP

• Must merge back into: DEVELOP and MASTER

• Branch naming convention:

Friday, August 10, 12

Page 70: Git Flow

gitflow: Supporting branches - RELEASE• Definition: support preparation of a new

production release. Allow for MINOR bug fixes and preparing meta-data for a release (version number, build dates, etc.)

• When? develop (almost) reflect the desired state of the new release. All planned features were implemented.

• Branch off from: DEVELOP

• Must merge back into: DEVELOP and MASTER

• Branch naming convention:

• <release>-* (release-1.0)Friday, August 10, 12

Page 71: Git Flow

gitflow: Supporting branches - HOTFIX

Friday, August 10, 12

Page 72: Git Flow

gitflow: Supporting branches - HOTFIX

Friday, August 10, 12

Page 73: Git Flow

gitflow: Supporting branches - HOTFIX• Definition: arise from the necessity to

act immediately upon an undesired state of a live production version. CRITICAL bugs!

Friday, August 10, 12

Page 74: Git Flow

gitflow: Supporting branches - HOTFIX• Definition: arise from the necessity to

act immediately upon an undesired state of a live production version. CRITICAL bugs!

• Branched off from the corresponding tag on the master branch that marks the production version.

Friday, August 10, 12

Page 75: Git Flow

gitflow: Supporting branches - HOTFIX• Definition: arise from the necessity to

act immediately upon an undesired state of a live production version. CRITICAL bugs!

• Branched off from the corresponding tag on the master branch that marks the production version.

• Branch off from: MASTER

Friday, August 10, 12

Page 76: Git Flow

gitflow: Supporting branches - HOTFIX• Definition: arise from the necessity to

act immediately upon an undesired state of a live production version. CRITICAL bugs!

• Branched off from the corresponding tag on the master branch that marks the production version.

• Branch off from: MASTER

• Must merge back into: DEVELOP and MASTER

Friday, August 10, 12

Page 77: Git Flow

gitflow: Supporting branches - HOTFIX• Definition: arise from the necessity to

act immediately upon an undesired state of a live production version. CRITICAL bugs!

• Branched off from the corresponding tag on the master branch that marks the production version.

• Branch off from: MASTER

• Must merge back into: DEVELOP and MASTER

• Branch naming convention:

Friday, August 10, 12

Page 78: Git Flow

gitflow: Supporting branches - HOTFIX• Definition: arise from the necessity to

act immediately upon an undesired state of a live production version. CRITICAL bugs!

• Branched off from the corresponding tag on the master branch that marks the production version.

• Branch off from: MASTER

• Must merge back into: DEVELOP and MASTER

• Branch naming convention:

• hotfix-* (hotfix-1.2.1)Friday, August 10, 12

Page 79: Git Flow

gitflowThe BIG picture

(again)

Friday, August 10, 12

Page 80: Git Flow

gitflowThe BIG picture

(again)

Friday, August 10, 12

Page 81: Git Flow

Feature. How?

Friday, August 10, 12

Page 82: Git Flow

Feature. How?• git checkout -b myfeature develop

Friday, August 10, 12

Page 83: Git Flow

Feature. How?• git checkout -b myfeature develop

• Switched to a new branch “myfeature”

Friday, August 10, 12

Page 84: Git Flow

Feature. How?• git checkout -b myfeature develop

• Switched to a new branch “myfeature”

• Do some work. When done...

Friday, August 10, 12

Page 85: Git Flow

Feature. How?• git checkout -b myfeature develop

• Switched to a new branch “myfeature”

• Do some work. When done...

• git checkout develop

Friday, August 10, 12

Page 86: Git Flow

Feature. How?• git checkout -b myfeature develop

• Switched to a new branch “myfeature”

• Do some work. When done...

• git checkout develop

• Switched to branch ‘develop’

Friday, August 10, 12

Page 87: Git Flow

Feature. How?• git checkout -b myfeature develop

• Switched to a new branch “myfeature”

• Do some work. When done...

• git checkout develop

• Switched to branch ‘develop’

• git merge --no-ff myfeature

Friday, August 10, 12

Page 88: Git Flow

Feature. How?• git checkout -b myfeature develop

• Switched to a new branch “myfeature”

• Do some work. When done...

• git checkout develop

• Switched to branch ‘develop’

• git merge --no-ff myfeature

• Updating ea1b92a...

Friday, August 10, 12

Page 89: Git Flow

Feature. How?• git checkout -b myfeature develop

• Switched to a new branch “myfeature”

• Do some work. When done...

• git checkout develop

• Switched to branch ‘develop’

• git merge --no-ff myfeature

• Updating ea1b92a...

• git branch -d myfeature

Friday, August 10, 12

Page 90: Git Flow

Feature. How?• git checkout -b myfeature develop

• Switched to a new branch “myfeature”

• Do some work. When done...

• git checkout develop

• Switched to branch ‘develop’

• git merge --no-ff myfeature

• Updating ea1b92a...

• git branch -d myfeature

• Deleted branch myfeature

Friday, August 10, 12

Page 91: Git Flow

Feature. How?• git checkout -b myfeature develop

• Switched to a new branch “myfeature”

• Do some work. When done...

• git checkout develop

• Switched to branch ‘develop’

• git merge --no-ff myfeature

• Updating ea1b92a...

• git branch -d myfeature

• Deleted branch myfeature

• git push origin develop

Friday, August 10, 12

Page 92: Git Flow

--no-ff

Friday, August 10, 12

Page 93: Git Flow

--no-ff• This flags causes the merge to

always create a new commit object.

Friday, August 10, 12

Page 94: Git Flow

--no-ff• This flags causes the merge to

always create a new commit object.

• Without it, it’s impossible to see from Git history which of the commit objects together have implemented a feature.

Friday, August 10, 12

Page 95: Git Flow

--no-ff• This flags causes the merge to

always create a new commit object.

• Without it, it’s impossible to see from Git history which of the commit objects together have implemented a feature.

• You will have to read all the log messages manually.

Friday, August 10, 12

Page 96: Git Flow

--no-ff• This flags causes the merge to

always create a new commit object.

• Without it, it’s impossible to see from Git history which of the commit objects together have implemented a feature.

• You will have to read all the log messages manually.

• Compare:

Friday, August 10, 12

Page 97: Git Flow

--no-ff• This flags causes the merge to

always create a new commit object.

• Without it, it’s impossible to see from Git history which of the commit objects together have implemented a feature.

• You will have to read all the log messages manually.

• Compare:

Friday, August 10, 12

Page 98: Git Flow

Create a release. How?

Friday, August 10, 12

Page 99: Git Flow

Create a release. How?

• git checkout -b release-1.2 develop

Friday, August 10, 12

Page 100: Git Flow

Create a release. How?

• git checkout -b release-1.2 develop

• Switched to a new branch “release-1.2”

Friday, August 10, 12

Page 101: Git Flow

Create a release. How?

• git checkout -b release-1.2 develop

• Switched to a new branch “release-1.2”

• Manually modify the README, RELEASE NOTES, etc.

Friday, August 10, 12

Page 102: Git Flow

Create a release. How?

• git checkout -b release-1.2 develop

• Switched to a new branch “release-1.2”

• Manually modify the README, RELEASE NOTES, etc.

• git commit -a -m “Bumped to version 1.2”

Friday, August 10, 12

Page 103: Git Flow

Create a release. How?

• git checkout -b release-1.2 develop

• Switched to a new branch “release-1.2”

• Manually modify the README, RELEASE NOTES, etc.

• git commit -a -m “Bumped to version 1.2”

• [release-1.2 74d9424] Bumped to version 1.2

Friday, August 10, 12

Page 104: Git Flow

Create a release. How?

• git checkout -b release-1.2 develop

• Switched to a new branch “release-1.2”

• Manually modify the README, RELEASE NOTES, etc.

• git commit -a -m “Bumped to version 1.2”

• [release-1.2 74d9424] Bumped to version 1.2

• 1 files changed, 1 insertions(+), 1 deletions(-)

Friday, August 10, 12

Page 105: Git Flow

Finish a release. How?

Friday, August 10, 12

Page 106: Git Flow

Finish a release. How?• When the release branch is ready to become a real release, it is merged into master (every commit on

master is a new release by definition) and the commit is tagged for easy future reference to this historical version. Finally it’s merged back into develop, so future releases contain the bug fixes.

Friday, August 10, 12

Page 107: Git Flow

Finish a release. How?• When the release branch is ready to become a real release, it is merged into master (every commit on

master is a new release by definition) and the commit is tagged for easy future reference to this historical version. Finally it’s merged back into develop, so future releases contain the bug fixes.

• git checkout master

Friday, August 10, 12

Page 108: Git Flow

Finish a release. How?• When the release branch is ready to become a real release, it is merged into master (every commit on

master is a new release by definition) and the commit is tagged for easy future reference to this historical version. Finally it’s merged back into develop, so future releases contain the bug fixes.

• git checkout master

• Switched to branch “master”

Friday, August 10, 12

Page 109: Git Flow

Finish a release. How?• When the release branch is ready to become a real release, it is merged into master (every commit on

master is a new release by definition) and the commit is tagged for easy future reference to this historical version. Finally it’s merged back into develop, so future releases contain the bug fixes.

• git checkout master

• Switched to branch “master”

• git merge --no-ff release-1.2

Friday, August 10, 12

Page 110: Git Flow

Finish a release. How?• When the release branch is ready to become a real release, it is merged into master (every commit on

master is a new release by definition) and the commit is tagged for easy future reference to this historical version. Finally it’s merged back into develop, so future releases contain the bug fixes.

• git checkout master

• Switched to branch “master”

• git merge --no-ff release-1.2

• Merge made by recursive. (Summary of changes)

Friday, August 10, 12

Page 111: Git Flow

Finish a release. How?• When the release branch is ready to become a real release, it is merged into master (every commit on

master is a new release by definition) and the commit is tagged for easy future reference to this historical version. Finally it’s merged back into develop, so future releases contain the bug fixes.

• git checkout master

• Switched to branch “master”

• git merge --no-ff release-1.2

• Merge made by recursive. (Summary of changes)

• To keep the changes made in the release branch, we need to merge those back into develop.

Friday, August 10, 12

Page 112: Git Flow

Finish a release. How?• When the release branch is ready to become a real release, it is merged into master (every commit on

master is a new release by definition) and the commit is tagged for easy future reference to this historical version. Finally it’s merged back into develop, so future releases contain the bug fixes.

• git checkout master

• Switched to branch “master”

• git merge --no-ff release-1.2

• Merge made by recursive. (Summary of changes)

• To keep the changes made in the release branch, we need to merge those back into develop.

• git tag -a 1.2 // Can use -s or -u <key> to sign cryptographically

Friday, August 10, 12

Page 113: Git Flow

Finish a release. How?• When the release branch is ready to become a real release, it is merged into master (every commit on

master is a new release by definition) and the commit is tagged for easy future reference to this historical version. Finally it’s merged back into develop, so future releases contain the bug fixes.

• git checkout master

• Switched to branch “master”

• git merge --no-ff release-1.2

• Merge made by recursive. (Summary of changes)

• To keep the changes made in the release branch, we need to merge those back into develop.

• git tag -a 1.2 // Can use -s or -u <key> to sign cryptographically

• git checkout develop

Friday, August 10, 12

Page 114: Git Flow

Finish a release. How?• When the release branch is ready to become a real release, it is merged into master (every commit on

master is a new release by definition) and the commit is tagged for easy future reference to this historical version. Finally it’s merged back into develop, so future releases contain the bug fixes.

• git checkout master

• Switched to branch “master”

• git merge --no-ff release-1.2

• Merge made by recursive. (Summary of changes)

• To keep the changes made in the release branch, we need to merge those back into develop.

• git tag -a 1.2 // Can use -s or -u <key> to sign cryptographically

• git checkout develop

• Switched to branch “develop”

Friday, August 10, 12

Page 115: Git Flow

Finish a release. How?• When the release branch is ready to become a real release, it is merged into master (every commit on

master is a new release by definition) and the commit is tagged for easy future reference to this historical version. Finally it’s merged back into develop, so future releases contain the bug fixes.

• git checkout master

• Switched to branch “master”

• git merge --no-ff release-1.2

• Merge made by recursive. (Summary of changes)

• To keep the changes made in the release branch, we need to merge those back into develop.

• git tag -a 1.2 // Can use -s or -u <key> to sign cryptographically

• git checkout develop

• Switched to branch “develop”

• git merge --no-ff release-1.2

Friday, August 10, 12

Page 116: Git Flow

Finish a release. How?• When the release branch is ready to become a real release, it is merged into master (every commit on

master is a new release by definition) and the commit is tagged for easy future reference to this historical version. Finally it’s merged back into develop, so future releases contain the bug fixes.

• git checkout master

• Switched to branch “master”

• git merge --no-ff release-1.2

• Merge made by recursive. (Summary of changes)

• To keep the changes made in the release branch, we need to merge those back into develop.

• git tag -a 1.2 // Can use -s or -u <key> to sign cryptographically

• git checkout develop

• Switched to branch “develop”

• git merge --no-ff release-1.2

• Merge made by recursive. (Summary of changes)

Friday, August 10, 12

Page 117: Git Flow

Finish a release. How?• When the release branch is ready to become a real release, it is merged into master (every commit on

master is a new release by definition) and the commit is tagged for easy future reference to this historical version. Finally it’s merged back into develop, so future releases contain the bug fixes.

• git checkout master

• Switched to branch “master”

• git merge --no-ff release-1.2

• Merge made by recursive. (Summary of changes)

• To keep the changes made in the release branch, we need to merge those back into develop.

• git tag -a 1.2 // Can use -s or -u <key> to sign cryptographically

• git checkout develop

• Switched to branch “develop”

• git merge --no-ff release-1.2

• Merge made by recursive. (Summary of changes)

• It may lead to a merge conflict. Fix it and commit.

Friday, August 10, 12

Page 118: Git Flow

Finish a release. How?• When the release branch is ready to become a real release, it is merged into master (every commit on

master is a new release by definition) and the commit is tagged for easy future reference to this historical version. Finally it’s merged back into develop, so future releases contain the bug fixes.

• git checkout master

• Switched to branch “master”

• git merge --no-ff release-1.2

• Merge made by recursive. (Summary of changes)

• To keep the changes made in the release branch, we need to merge those back into develop.

• git tag -a 1.2 // Can use -s or -u <key> to sign cryptographically

• git checkout develop

• Switched to branch “develop”

• git merge --no-ff release-1.2

• Merge made by recursive. (Summary of changes)

• It may lead to a merge conflict. Fix it and commit.

• Now we are really done and the release branch may be removed, since we don’t need it anymore.

Friday, August 10, 12

Page 119: Git Flow

Finish a release. How?• When the release branch is ready to become a real release, it is merged into master (every commit on

master is a new release by definition) and the commit is tagged for easy future reference to this historical version. Finally it’s merged back into develop, so future releases contain the bug fixes.

• git checkout master

• Switched to branch “master”

• git merge --no-ff release-1.2

• Merge made by recursive. (Summary of changes)

• To keep the changes made in the release branch, we need to merge those back into develop.

• git tag -a 1.2 // Can use -s or -u <key> to sign cryptographically

• git checkout develop

• Switched to branch “develop”

• git merge --no-ff release-1.2

• Merge made by recursive. (Summary of changes)

• It may lead to a merge conflict. Fix it and commit.

• Now we are really done and the release branch may be removed, since we don’t need it anymore.

• git branch -d release-1.2

Friday, August 10, 12

Page 120: Git Flow

Finish a release. How?• When the release branch is ready to become a real release, it is merged into master (every commit on

master is a new release by definition) and the commit is tagged for easy future reference to this historical version. Finally it’s merged back into develop, so future releases contain the bug fixes.

• git checkout master

• Switched to branch “master”

• git merge --no-ff release-1.2

• Merge made by recursive. (Summary of changes)

• To keep the changes made in the release branch, we need to merge those back into develop.

• git tag -a 1.2 // Can use -s or -u <key> to sign cryptographically

• git checkout develop

• Switched to branch “develop”

• git merge --no-ff release-1.2

• Merge made by recursive. (Summary of changes)

• It may lead to a merge conflict. Fix it and commit.

• Now we are really done and the release branch may be removed, since we don’t need it anymore.

• git branch -d release-1.2

• Deleted branch release-1.2 (was ff452fe)

Friday, August 10, 12

Page 121: Git Flow

Create a hotfix. How?

Friday, August 10, 12

Page 122: Git Flow

Create a hotfix. How?• git checkout -b hotfix-1.2.1 master

Friday, August 10, 12

Page 123: Git Flow

Create a hotfix. How?• git checkout -b hotfix-1.2.1 master

• Switched to a new branch “hotfix-1.2.1”

Friday, August 10, 12

Page 124: Git Flow

Create a hotfix. How?• git checkout -b hotfix-1.2.1 master

• Switched to a new branch “hotfix-1.2.1”

• Manually modify the README, RELEASE NOTES, etc.

Friday, August 10, 12

Page 125: Git Flow

Create a hotfix. How?• git checkout -b hotfix-1.2.1 master

• Switched to a new branch “hotfix-1.2.1”

• Manually modify the README, RELEASE NOTES, etc.

• git commit -a -m “Bumped to version 1.2.1”

Friday, August 10, 12

Page 126: Git Flow

Create a hotfix. How?• git checkout -b hotfix-1.2.1 master

• Switched to a new branch “hotfix-1.2.1”

• Manually modify the README, RELEASE NOTES, etc.

• git commit -a -m “Bumped to version 1.2.1”

• [hotfix-1.2.1 416e61] Bumped to version 1.2.1

Friday, August 10, 12

Page 127: Git Flow

Create a hotfix. How?• git checkout -b hotfix-1.2.1 master

• Switched to a new branch “hotfix-1.2.1”

• Manually modify the README, RELEASE NOTES, etc.

• git commit -a -m “Bumped to version 1.2.1”

• [hotfix-1.2.1 416e61] Bumped to version 1.2.1

• 1 files changed, 1 insertions(+), 1 deletions(-)

Friday, August 10, 12

Page 128: Git Flow

Create a hotfix. How?• git checkout -b hotfix-1.2.1 master

• Switched to a new branch “hotfix-1.2.1”

• Manually modify the README, RELEASE NOTES, etc.

• git commit -a -m “Bumped to version 1.2.1”

• [hotfix-1.2.1 416e61] Bumped to version 1.2.1

• 1 files changed, 1 insertions(+), 1 deletions(-)

• Fix the bug and commit the fix.

Friday, August 10, 12

Page 129: Git Flow

Create a hotfix. How?• git checkout -b hotfix-1.2.1 master

• Switched to a new branch “hotfix-1.2.1”

• Manually modify the README, RELEASE NOTES, etc.

• git commit -a -m “Bumped to version 1.2.1”

• [hotfix-1.2.1 416e61] Bumped to version 1.2.1

• 1 files changed, 1 insertions(+), 1 deletions(-)

• Fix the bug and commit the fix.

• git commit -m “Fixed severe production problem”

Friday, August 10, 12

Page 130: Git Flow

Create a hotfix. How?• git checkout -b hotfix-1.2.1 master

• Switched to a new branch “hotfix-1.2.1”

• Manually modify the README, RELEASE NOTES, etc.

• git commit -a -m “Bumped to version 1.2.1”

• [hotfix-1.2.1 416e61] Bumped to version 1.2.1

• 1 files changed, 1 insertions(+), 1 deletions(-)

• Fix the bug and commit the fix.

• git commit -m “Fixed severe production problem”

• [hotfix-1.2.1 416e61] Fixed severe production problem.

Friday, August 10, 12

Page 131: Git Flow

Create a hotfix. How?• git checkout -b hotfix-1.2.1 master

• Switched to a new branch “hotfix-1.2.1”

• Manually modify the README, RELEASE NOTES, etc.

• git commit -a -m “Bumped to version 1.2.1”

• [hotfix-1.2.1 416e61] Bumped to version 1.2.1

• 1 files changed, 1 insertions(+), 1 deletions(-)

• Fix the bug and commit the fix.

• git commit -m “Fixed severe production problem”

• [hotfix-1.2.1 416e61] Fixed severe production problem.

• 5 files changed, 32 insertions(+), 17 deletions(-)

Friday, August 10, 12

Page 132: Git Flow

Finish a hotfix. How?

Friday, August 10, 12

Page 133: Git Flow

Finish a hotfix. How?• git checkout master

Friday, August 10, 12

Page 134: Git Flow

Finish a hotfix. How?• git checkout master

• Switched to branch “master”

Friday, August 10, 12

Page 135: Git Flow

Finish a hotfix. How?• git checkout master

• Switched to branch “master”

• git merge --no-ff hotfix-1.2.1

Friday, August 10, 12

Page 136: Git Flow

Finish a hotfix. How?• git checkout master

• Switched to branch “master”

• git merge --no-ff hotfix-1.2.1

• Merge made by recursive. (Summary of changes)

Friday, August 10, 12

Page 137: Git Flow

Finish a hotfix. How?• git checkout master

• Switched to branch “master”

• git merge --no-ff hotfix-1.2.1

• Merge made by recursive. (Summary of changes)

• git tag -a 1.2.1 // Again, this can be done cryptographically

Friday, August 10, 12

Page 138: Git Flow

Finish a hotfix. How?• git checkout master

• Switched to branch “master”

• git merge --no-ff hotfix-1.2.1

• Merge made by recursive. (Summary of changes)

• git tag -a 1.2.1 // Again, this can be done cryptographically

• Include the bugfix in develop too. The exception: if there is a release branch, the hotfix changes need to be merge into that release branch instead of develop.

Friday, August 10, 12

Page 139: Git Flow

Finish a hotfix. How?• git checkout master

• Switched to branch “master”

• git merge --no-ff hotfix-1.2.1

• Merge made by recursive. (Summary of changes)

• git tag -a 1.2.1 // Again, this can be done cryptographically

• Include the bugfix in develop too. The exception: if there is a release branch, the hotfix changes need to be merge into that release branch instead of develop.

• git checkout develop

Friday, August 10, 12

Page 140: Git Flow

Finish a hotfix. How?• git checkout master

• Switched to branch “master”

• git merge --no-ff hotfix-1.2.1

• Merge made by recursive. (Summary of changes)

• git tag -a 1.2.1 // Again, this can be done cryptographically

• Include the bugfix in develop too. The exception: if there is a release branch, the hotfix changes need to be merge into that release branch instead of develop.

• git checkout develop

• Switched to branch ‘develop’

Friday, August 10, 12

Page 141: Git Flow

Finish a hotfix. How?• git checkout master

• Switched to branch “master”

• git merge --no-ff hotfix-1.2.1

• Merge made by recursive. (Summary of changes)

• git tag -a 1.2.1 // Again, this can be done cryptographically

• Include the bugfix in develop too. The exception: if there is a release branch, the hotfix changes need to be merge into that release branch instead of develop.

• git checkout develop

• Switched to branch ‘develop’

• git merge --no-ff hotfix-1.2.1

Friday, August 10, 12

Page 142: Git Flow

Finish a hotfix. How?• git checkout master

• Switched to branch “master”

• git merge --no-ff hotfix-1.2.1

• Merge made by recursive. (Summary of changes)

• git tag -a 1.2.1 // Again, this can be done cryptographically

• Include the bugfix in develop too. The exception: if there is a release branch, the hotfix changes need to be merge into that release branch instead of develop.

• git checkout develop

• Switched to branch ‘develop’

• git merge --no-ff hotfix-1.2.1

• Merge made by recursive. (Summary of changes)

Friday, August 10, 12

Page 143: Git Flow

Finish a hotfix. How?• git checkout master

• Switched to branch “master”

• git merge --no-ff hotfix-1.2.1

• Merge made by recursive. (Summary of changes)

• git tag -a 1.2.1 // Again, this can be done cryptographically

• Include the bugfix in develop too. The exception: if there is a release branch, the hotfix changes need to be merge into that release branch instead of develop.

• git checkout develop

• Switched to branch ‘develop’

• git merge --no-ff hotfix-1.2.1

• Merge made by recursive. (Summary of changes)

• Finally remove the temporary branch

Friday, August 10, 12

Page 144: Git Flow

Finish a hotfix. How?• git checkout master

• Switched to branch “master”

• git merge --no-ff hotfix-1.2.1

• Merge made by recursive. (Summary of changes)

• git tag -a 1.2.1 // Again, this can be done cryptographically

• Include the bugfix in develop too. The exception: if there is a release branch, the hotfix changes need to be merge into that release branch instead of develop.

• git checkout develop

• Switched to branch ‘develop’

• git merge --no-ff hotfix-1.2.1

• Merge made by recursive. (Summary of changes)

• Finally remove the temporary branch

• git branch -d hotfix-1.2.1

Friday, August 10, 12

Page 145: Git Flow

Finish a hotfix. How?• git checkout master

• Switched to branch “master”

• git merge --no-ff hotfix-1.2.1

• Merge made by recursive. (Summary of changes)

• git tag -a 1.2.1 // Again, this can be done cryptographically

• Include the bugfix in develop too. The exception: if there is a release branch, the hotfix changes need to be merge into that release branch instead of develop.

• git checkout develop

• Switched to branch ‘develop’

• git merge --no-ff hotfix-1.2.1

• Merge made by recursive. (Summary of changes)

• Finally remove the temporary branch

• git branch -d hotfix-1.2.1

• Deleted branch hotfix-1.2.1 (was abbe5d6)

Friday, August 10, 12

Page 146: Git Flow

It was just a flesh wound, right?

That’s it!

Friday, August 10, 12

Page 147: Git Flow

Referenceshttp://nvie.com/posts/a-successful-git-branching-model/

http://learn.github.com/p/tagging.html

http://reinh.com/blog/2009/03/02/a-git-workflow-for-agile-teams.html

http://stackoverflow.com/questions/1616957/how-do-you-roll-back-reset-a-git-repository-to-a-particular-commit

http://stackoverflow.com/questions/1457103/what-is-the-difference-between-a-tag-and-a-branch-in-git

Friday, August 10, 12

Page 148: Git Flow

Thanks!

Friday, August 10, 12


Recommended