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?
4. You heard
has
Cheap local branching
Full local history
10x the speed of svn
Staging area
Speed
Huge community
Feature based workflow
prominent in Open Source
cryptographic integrity
Distributed
7. Can we do a fast
Can we fix a bug for the
upcoming
RELEASE
HOTFIXrelease?
for the current
?
Can we
BUILD
the current code ?
Is the code for that
FEATURE
complete?
Has everybody
REVIEWED ?
the code for this feature
25. staging
promoted from staging, can receive hotfixes
Time
feature
master/
production
master is in production
PR
staging is the next version
new features off staging
with branch names like:
username/ISSUE-KEY-summary
26. staging
promoted from staging, can receive hotfixes
Time
feature
master/
production
master is in production
PR
staging is the next version
new features off staging
with branch names like:
Hotfix
username/ISSUE-KEY-summary
27. staging
promoted from staging, can receive hotfixes
Time
feature
master/
production
master is in production
PR
staging is the next version
new features off staging
with branch names like:
Hotfix
username/ISSUE-KEY-summary
61. The secret sauce
The merge protocol
When a branch is:
Change flows from
branch to baseline:
Change flows from baseline
to branch:
More stable than its
baseline
Continuously
Never
Less stable than its
baseline
When code complete
Continuously
62. The secret sauce
The merge protocol
When a branch is:
Change flows from
branch to baseline:
Change flows from baseline
to branch:
More stable than its
baseline
Continuously
Never
Less stable than its
baseline
When code complete
Continuously
63. The secret sauce
The merge protocol
When a branch is:
Change flows from
branch to baseline:
Change flows from baseline
to branch:
More stable than its
baseline
Continuously
Never
When code complete
Continuously
Release branch
Less stable than its
baseline
64. The secret sauce
The merge protocol
When a branch is:
Change flows from
branch to baseline:
Change flows from baseline
to branch:
More stable than its
baseline
Continuously
Never
When code complete
Continuously
Release branch
Less stable than its
baseline
65. The secret sauce
The merge protocol
When a branch is:
Change flows from
branch to baseline:
Change flows from baseline
to branch:
More stable than its
baseline
Continuously
Never
When code complete
Continuously
Release branch
Less stable than its
baseline
66. The secret sauce
The merge protocol
When a branch is:
Change flows from
branch to baseline:
Change flows from baseline
to branch:
More stable than its
baseline
Continuously
Never
When code complete
Continuously
Release branch
Less stable than its
baseline
67. The secret sauce
The merge protocol
When a branch is:
Change flows from
branch to baseline:
Change flows from baseline
to branch:
More stable than its
baseline
Continuously
Never
When code complete
Continuously
Release branch
Less stable than its
baseline
Feature branches
68. The secret sauce
The merge protocol
When a branch is:
Change flows from
branch to baseline:
Change flows from baseline
to branch:
More stable than its
baseline
Continuously
Never
When code complete
Continuously
Release branch
Less stable than its
baseline
Feature branches
69. The secret sauce
The merge protocol
When a branch is:
Change flows from
branch to baseline:
Change flows from baseline
to branch:
More stable than its
baseline
Continuously
Never
When code complete
Continuously
Release branch
Less stable than its
baseline
Feature branches
70. The secret sauce
The merge protocol
When a branch is:
Change flows from
branch to baseline:
Change flows from baseline
to branch:
More stable than its
baseline
Continuously
Never
When code complete
Continuously
Release branch
Less stable than its
baseline
Feature branches
Credit: Laura Wingerd - The Flow of change
114. Recommendation?
Explicit merges into the mainline
4
Don’t fear the Merge! Use it!
git log --first-parent
5
May rebase feature branches
To update the feature branch
115. Recommendation?
Explicit merges into the mainline
4
Don’t fear the Merge! Use it!
git log --first-parent
After review!
5
May rebase feature branches
To update the feature branch
116. Recommendation?
Explicit merges into the mainline
4
Don’t fear the Merge! Use it!
git log --first-parent
After review!
5
May rebase feature branches
To update the feature branch
6
Work with the tool!
117. Recommendation?
Explicit merges into the mainline
4
Don’t fear the Merge! Use it!
git log --first-parent
After review!
5
May rebase feature branches
To update the feature branch
6
Work with the tool!
Trying to strive for a linearized history is less useful than you think
153. $ git checkout master
master is lookin'good!
c4f3b4b has 4 green builds.
$ git checkout stable-2.3
DANGER! stable-2.3 is
busted. e1324fa has 2 red
builds.