SlideShare ist ein Scribd-Unternehmen logo
1 von 178
Downloaden Sie, um offline zu lesen
The gitworkflows(7)
illustrated
by K. Tateishi
(@ktateish)
What’s gitworkflows?
A set of workflows used in the Git project itself.
Details are described in the online manual
gitworkflows(7) shipped with Git.
Why gitworkflows?
● You can push -f for integration branches
● You can merge topic branches casually
● You can keep master stable with clear
history
● Scalable to a large number of developers
You know you can freely modify your commits
and topic branches with Git. You can do it for
integration branches with gitworkflows.
In these slides
I’ll show you how gitworkflows* work with
simple commit graphs.
It helps you to understand gitworkflows even
though they are little complicated.
Here we go.
* Maybe slightly different from actual workflows used by git.git, because these slides are based on my
interpretation of the gitworkflows(7).
There is an initial commit.
Let’s start from here.
master
This is the ‘master’ branch
This is the ‘master’ branch
Say you need three topics (A, B, C) for the first release.
A
B
C
Grow them...
A
B
C
And they’ve done.
Integrate to master?
No. ‘master’ can’t be reset after topics once merged
(and pushed to public repositories).
Use a ‘throw-away’ integration branch instead.
‘pu’ is the name of the throw-away integration branch.
Stands for ‘Proposed Update’
pu
‘pu’ should be branched from the tip of the most advanced
non-throw-away branch.
‘master’ would be fine at this time.
(You may use git branch pu master)
Merge topic A…
(checkout pu and merge topic-A. You can use --
no-ff merge like below if you want)
merge
Merge topic A, B...
merge
Merge topic A, B and C into ‘pu’.
merge
Then, let’s do tests especially about interactions among the
merged topics/features. (They can’t be tested on each
branch)
BTW you can push ‘pu’ to public repositories if needed.
(push origin pu)
e.g. a CI server is watching a public repository for running
automated tests and you want to push for it.
You may find some bugs/lacks of functionalities on ‘pu’
with integrated state of the three topics.
One of them was introduced on topic A
So fix it on that topic.
commit
Others should be added/fixed on each branch.
commit
And merge them into ‘pu’?
No.
‘pu’ is a throw-away integration branch.
So reset ‘pu’ to ‘master’
(checkout pu and reset --hard master)
reset
So reset ‘pu’ to ‘master’ so that throw away the old ‘pu’.
(checkout pu and reset --hard master)
And then, re-do merges...
merge
And then, re-do merges...
merge
And then, re-do merges...
merge
Now you’ve got new ‘pu’ that cleanly merged three
topics.
Note that all developers involved including you can’t work
on ‘pu’. All topics have to be forked off from ‘master’
Without reset, resulting branch / commit graph would be little
more complicated, even though they have identical trees.
trees of these two commits
are identical
- with reset
- without reset
OK. Let’s push new ‘pu’ to public repositories and test it.
You have to do push -f origin pu or push origin
+pu if you’ve pushed old ‘pu’ before, because new ‘pu’ isn’t
direct descendant of the old ‘pu’ on origin.
After test, you found that two features from topic A, B were
good and stable but one from topic C wasn’t.
You decide to merge topic A and B into ‘master’ because
they are stable enough.
Merge topic A…
(checkout master and merge topic-A)
merge
Merge topic A and B into ‘master’.
merge
# Now topic A, B are not important any more for these slides.
# So gray out them.
At the same time, a bug on topic C was spotted and fixed.
Let’s rebuild ‘pu’.
commit
‘pu’ should be reset to ‘master’ again.
(checkout pu and reset --hard master)
reset
Resetting ‘pu’ also means that throwing away the old
‘pu’.
And then...
Merge topic C, then push ‘master’ and ‘pu’.
Again, you have to use forced push for ‘pu’, so you may say:
git push origin master +pu
(prefix ‘+’ for the branch name means forced push.)
merge
You want more time to stabilize topic C.
So you decide to make the first release with two features
already merged into ‘master’.
For making release, tag an annotated tag ( ) at ‘master’
tag
v1.0.0
The release tag name is ‘v1.0.0’
Then push it.
(tag -a ‘v1.0.0’ master and push origin v1.
0.0)
tag
v1.0.0 was released.
v1.0.0
You received new topics created after release. They
would be branched from ‘master’.
new topics
Some new topics would be good but some are possibly
not good (i.e. break something).
So new topics should be merged into ‘pu’ first.
merge
Merge another topic into ‘pu’ and push it.
merge
You find two of three active topic branches look good
after tests. But you are unsure for...
Good
Good
Unsure for: - Stability of the implementation
- Excellence of the design
- Requirement of the feature
etc.
It means that keeping them in ‘pu’ is tiring because they
won’t be changed for a while, but merging them into
‘master’ can’t be done because they may be changed or
possibly deleted.
In other words, you need an integration branch for
stabilizing, testing or previews for those topics.
‘next’ is the integration branch for such use. It’s like a
hybrid of throw-away and non throw-away. You can
reset ‘next’ with an announcement for developers, but
don’t do it so frequently.
next
tag
‘next’ will be branched from ‘master’.
(branch next master)
Merge the remaining old active topic, C…
(checkout next and merge topic-C)
merge
And merge new one, say topic D.
merge
Here, ‘pu’ always should be branched from the most
advanced non-throw-away integration branch.
So let’s rebuild ‘pu’ on ‘next’ at this time.
(checkout pu and reset --hard next)
reset
Old ‘pu’ will be deleted.
And then...
Merge the remaining new topic, say topic E.
merge
Then, push ‘next’ and ‘pu’
(push origin next +pu)
Note that you and developers involved cannot work on
‘next’ because it sometimes get reset. So all feature
branches should be forked off from ‘master’
What are the differences between ‘next’ and ‘pu’?
‘pu’ is easily disposable but ‘next’ isn’t.
For example, if a topic merged only to ‘pu’ have a bug and
fixed on it ...
commit
Then, simply reset ‘pu’ to ‘next’...
(checkout pu and reset --hard next)
reset
And merge new tip of that topic.
(i.e. rewind and reconstruct ‘pu’)
merge
On the other hand, if a topic kept in ‘next’ have another
commit...
commit
‘next’ can’t be reset, so just merge new tip of that topic
on current ‘next’...
Like this.
merge
And rebuild ‘pu’ on new ‘next’
reset and
merge
Note that you can merge the new branch head of topic D
into ‘pu’ first if needed.
(e.g. it has too large impact to merge into ‘next’)
merge into ‘pu’ first
(+ push and test)
if it looks good,
then merge into ‘next’
reconstruct ‘pu’.
this is identical graph
shown in previous page
Here is another situation.
You got new topic (say F).
You found a topic kept in ‘pu’, topic E, was totally broken
and the topic developer can’t fix it right away. When it
happened, just reconstruct ‘pu’ ignoring broken
branches.
Broken
Reset ‘pu’....
reset
And merge again only good branches.
merge
If the broken branch was rebased with fixes after a
while...
rebased
rebased
topic
Merge the rebased new branch into ‘pu’
rebased merge
If you find a branch kept in ‘next’, e.g. topic C, is broken
and it can’t be fixed for a while...
Broken
You should revert the whole branch
(revert -m 1 <merge commit>)
revert
revert commit
reverted
merge
Of course you should rebuild ‘pu’ and push them.
reset and
merge
After a while, when the topic C was fixed all bugs rebasing
it...
rebased
Merge it into ‘next’...
merge
And rebuild ‘pu’, then push ‘next’ and ‘pu’.
reset and
merge
Again, note that ‘next’ shouldn’t be reset easily like ‘pu’.
When you want to redo something on ‘next’, just revert or re-
merge instead.
But ‘next’ can be reset with announcements for involved
developers when it get awfully dirty with a number of revert
and duplicate merges.
And you’ll also have chances to reset ‘next’ after feature
release. It will be shown later.
Let’s keep developing for the second release for now.
When you think topics merged into ‘next’ are stable / having
good design / etc. you can merge them into ‘master’
Good enough to be
merged into ‘master’
When you think topics merged into ‘next’ are stable / having
good design / etc. you can merge them into ‘master’
Good enough to be
merged into ‘master’
Repeat ‘pu’ -> ‘next’ -> ‘master’ cycle until enough features
required for the next feature release are merged into
‘master’
new topic
Repeat ‘pu’ -> ‘next’ -> ‘master’ cycle until enough features
required for the next feature release are merged into
‘master’
merge
Repeat ‘pu’ -> ‘next’ -> ‘master’ cycle until enough features
required for the next feature release are merged into
‘master’
good enough
for master
Repeat ‘pu’ -> ‘next’ -> ‘master’ cycle until enough features
required for the next feature release are merged into
‘master’
merge
Repeat ‘pu’ -> ‘next’ -> ‘master’ cycle until enough features
required for the next feature release are merged into
‘master’
good enough
for next
Repeat ‘pu’ -> ‘next’ -> ‘master’ cycle until enough features
required for the next feature release are merged into
‘master’
merge
reset and
merge
Repeat ‘pu’ -> ‘next’ -> ‘master’ cycle until enough features
required for the next feature release are merged into
‘master’
new topic
Repeat ‘pu’ -> ‘next’ -> ‘master’ cycle until enough features
required for the next feature release are merged into
‘master’
merge
Repeat ‘pu’ -> ‘next’ -> ‘master’ cycle until enough features
required for the next feature release are merged into
‘master’
good enough
for next
Repeat ‘pu’ -> ‘next’ -> ‘master’ cycle until enough features
required for the next feature release are merged into
‘master’
merge
reset and
merge
These merges in ‘pu’ -> ‘next’ -> ‘master’ order,
downstream-ward propagation of features, are called
‘graduate’.
Unfortunately sometimes even topics merged into ‘master’
have bugs.
Fix them on their topics? No.
a bug found
Once a topic merged into ‘master’, it will be regarded as
‘master’ itself. So fix branches should be created on
‘master’ for bugs of ‘master’.
fix-branch for the bug
Merge it into (‘pu’ and) ‘next’ first.
merge
reset and merge
Then merge it into ‘master’ if it looks good.
merge
Note that you can merge the fix branch into ‘master’ directly
when the commits in fix branch are trivial.
fix-branch for the bug
Note that you can merge the fix branch into ‘master’ directly
when the commits in fix branch are trivial.
merge
But after that, don’t forget to merge ‘master’ into ‘next’ for
the fix will be included in ‘next’
(‘next’ must have the bug because it has all topics merged
into ‘master’)
merge
reset and merge
There is another situation for fixing bugs.
If the release v1.0.0 have a bug, how should we address it?
a bug found
Fix it on ‘master’ and let v1.0.0 users upgrade to ‘master’?
But some v1.0.0 users don’t want to use new features
merged into ‘master’.
So you want a new integration branch only for bug fixing.
‘maint’ is such a branch. It will be branched from the latest
feature release, i.e. v1.0.0.
maint
create branch
The fix branch have to be branched from ‘maint’.
Don’t branch from ‘master’ or any upstream.
fix-branch for the bug
If you branch the fix branch for ‘maint’ from ‘master’...
*WRONG*
fix-branch for the bug
*WRONG*
When the fix branch merged into ‘maint’, additional topics
are also merged into ‘maint’. Those downwards merging will
break ‘maint’ branch.
*WRONG*
merge
*WRONG*
unintentionally
merged commits
You can handle this case by cherry-pick the commit into
‘maint’, but you should take care where you fork off from.
cherry-pick
workaround
So the fix branch should be forked off from ‘maint’.
As a general rule, fork off topics from the oldest integration
branch which the topics will be finally merged into.
fix-branch for the bug
Basically merge the fix branch for ‘maint’ into ‘next’ (or ‘pu’)
first as usual because ‘maint’ never get reset.
merge
reset and merge
Then merge it into ‘maint’ when it looks good on ‘next’.
merge
But...
Of course you can merge fix branches directly into ‘maint’
when they are trivial.
merge
Sometimes you should merge ‘maint’ into ‘master’, and
merge ‘master’ into ‘next’ for propagation of the fixes.
Periodic upward merges are good habits.
Sometimes you should merge ‘maint’ into ‘master’, and
merge ‘master’ into ‘next’ for propagation of the fixes.
Periodic upward merges are good habits.
merge
Sometimes you should merge ‘maint’ into ‘master’, and
merge ‘master’ into ‘next’ for propagation of the fixes.
Periodic upward merges are good habits.
Sometimes you should merge ‘maint’ into ‘master’, and
merge ‘master’ into ‘next’ for propagation of the fixes.
Periodic upward merges are good habits.
merge
Sometimes you should merge ‘maint’ into ‘master’, and
merge ‘master’ into ‘next’ for propagation of the fixes.
Periodic upward merges are good habits.
merge
Sometimes you should merge ‘maint’ into ‘master’, and
merge ‘master’ into ‘next’ for propagation of the fixes.
Periodic upward merges are good habits.
merge
Sometimes you should merge ‘maint’ into ‘master’, and
merge ‘master’ into ‘next’ for propagation of the fixes.
Periodic upward merges are good habits.
reset and merge
Sometimes you should merge ‘maint’ into ‘master’, and
merge ‘master’ into ‘next’ for propagation of the fixes.
Periodic upward merges are good habits.
When some fixes accumulated in ‘maint’, publish a fix-
release.
Tag v1.0.1 on ‘maint’ for the fix-release and push it.
v1.
0.1
tag
Well, after a while you want to make a new feature-release.
And you want have a code-freeze period for this release.
To freeze your code, just stop merging feature topics and
only merge fix-topics, including ‘maint’, into ‘master’.
merge fix branches only
while frozen
To freeze your code, just stop merging feature topics and
only merge fix-topics, including ‘maint’, into ‘master’.
fix
fix
feature
To freeze your code, just stop merging feature topics and
only merge fix-topics, including ‘maint’, into ‘master’.
fix
feature
fix
To freeze your code, just stop merging feature topics and
only merge fix-topics, including ‘maint’, into ‘master’.
fix
feature
merging maint is ok
fix
To freeze your code, just stop merging feature topics and
only merge fix-topics, including ‘maint’, into ‘master’.
fix
feature
merging fix branches
are also ok
fix
To freeze your code, just stop merging feature topics and
only merge fix-topics, including ‘maint’, into ‘master’.
fix
feature
Don’t merge feature
branches
fix
To freeze your code, just stop merging feature topics and
only merge fix-topics, including ‘maint’, into ‘master’.
fix
feature
Don’t merge feature
branches
fix
To freeze your code, just stop merging feature topics and
only merge fix-topics, including ‘maint’, into ‘master’.
fix
feature
fix
To freeze your code, just stop merging feature topics and
only merge fix-topics, including ‘maint’, into ‘master’.
fix
feature
fix
even though good
enough for master...
To freeze your code, just stop merging feature topics and
only merge fix-topics, including ‘maint’, into ‘master’.
fix
feature
Don’t merge ANY
feature branches
fix
To freeze your code, just stop merging feature topics and
only merge fix-topics, including ‘maint’, into ‘master’.
fix
feature
Don’t merge ANY
feature branches
fix
To freeze your code, just stop merging feature topics and
only merge fix-topics, including ‘maint’, into ‘master’.
fix
feature
fix
You can merge feature topics into ‘next’ for integration of
them while ‘master’ is frozen. So you don’t have to stop
developing for the code-freeze.
merging feature
branches are OKay
fix
feature
fix
You can merge feature topics into ‘next’ for integration of
them while ‘master’ is frozen. So you don’t have to stop
developing for the code-freeze.
merging fix branches
are also OKay
fix
feature
fix
You can merge feature topics into ‘next’ for integration of
them while ‘master’ is frozen. So you don’t have to stop
developing for the code-freeze.
You can merge feature topics into ‘next’ for integration of
them while ‘master’ is frozen. So you don’t have to stop
developing for the code-freeze.
rebase
rebasing active topics
are OKay
You can merge feature topics into ‘next’ for integration of
them while ‘master’ is frozen. So you don’t have to stop
developing for the code-freeze.
rebase
rebasing active topics
are OKay
You can merge feature topics into ‘next’ for integration of
them while ‘master’ is frozen. So you don’t have to stop
developing for the code-freeze.
reverting or dropping
active branches are also
OKay
revert
You can merge feature topics into ‘next’ for integration of
them while ‘master’ is frozen. So you don’t have to stop
developing for the code-freeze.
reverting or dropping
active branches are also
OKay
The code-freeze period has done. Now you will make
feature-release.
Before tagging, make sure ‘maint’ is fully merged into
‘master’ by git merge maint on ‘master’. If not merged,
some fixes will be missing from the new release.
Already fully merged
into master in this case
Now release it. Tag v1.1.0 on ‘master’ for the feature-
release and push it.
tag
v1.
1.0
New release has done. But you have some tasks for the
‘next’ and ‘maint’ after feature-release
Let’s do for ‘next’.
At first reset ‘next’ to ‘master’
reset to
master
leave a tag for in
case messed up
Then merge active topics they weren’t included in the last
release. (And rebuild ‘pu’ if needed)
merge active
branches
Then merge active topics they weren’t included in the last
release. (And rebuild ‘pu’ if needed)
merge active
branches
Then merge active topics they weren’t included in the last
release. (And rebuild ‘pu’ if needed)
check diff for
making sure that
they are
equivalentdiff
Then merge active topics they weren’t included in the last
release. (And rebuild ‘pu’ if needed)
rebuild pu
This rewind and reconstruction of ‘next’ is for cleaning up the
history of it. Actually you can do this anytime with an
announcement. But it is good point to do this right after a
feature release.
This rewind and reconstruction of ‘next’ is for cleaning up the
history of it. Actually you can do this anytime with an
announcement. But it is good point to do this right after a
feature release.
Next, let’s see about ‘maint’
The task for ‘maint’ is simple. Just fast-forward ‘maint’ to
‘master’.
Fast-Foward
to master
This is done by git merge --ff-only master on
‘maint’. If it fail, the last release is missing some fixes
because ‘maint’ must have some commits that are not in
‘master’.
Fast-Foward
to master
If you merge ‘maint’ into ‘master’ before the release like
already shown, the fast-forward will succeed.
Note that if you want keep maintenance branch for the
previous feature-release, you can leave another maint
branch, e.g. maint-1.0, for it.
maint-1.0
After the feature-release, repeat the same workflows
already shown. This is the gitworkflows(7). Keep on
developing with it.
New topic and...
Conclusion (1/2)
● Use throw-away integration branch like pu
● Merge topics into the throw-away(TA) first
● Test in TAs before merging topics into master
● You can use hybrid of TA and non-TA like
next
● next can be reset with announcements.
● master and maint cannot be reset
Conclusion (2/2)
● Don’t base your work on pu or next
● Fork off topics from the oldest integ-branch
which the topics will be finally merged into
● Merge integration branches upwards
● Tag master for feature-releases
● Tag maint for fix-releases
See also
● gitworkflows(7)
● Documentation/SubmittingPatches
in Git source tree
● MaintNote in ‘todo’ branch of git.git
● the Git Blame blog by Junio C Hamano
Q and A
Q: What is the difference between next and pu?
A: It depends.
gitworkflows(7) saids pu, throw-away, is for testing the
interaction of topics but according to the recent MaintNotes in
the git.git, pu is a sort of reminder for the maintainer. next is
said to be for testing/polishing for master in both documents.
IMHO pu is a working space and next is a staging area for
master. It looks like working tree and index of Git itself.
Q: Do I have to keep {‘pu’, ‘next’, ‘maint’}
A: No, you don’t.
Just create and keep them if you need. But I recommend you
to use a throw-away at least. You may keep it in your local
repos only (i.e. make sure tests are succeeded and then
push master).
I’ve seen a project that have only ‘master’, ‘pu’ and another
project that have ‘master’, ‘master-pu’, ‘maint’, ‘maint-pu’.
Q: Do I have to keep so many topics?
A: Yes.
You have to keep them until they’ve been merged into
‘master’ or ‘maint’
But you can assign someone you trust to maintain a certain
subsystem with gitworkflows. Then you can just merge
his/her ‘master’ into your ‘master’. (actually you need a
throw-away)
This is the reason why gitworkflows is thought to be scalable.
Q: Do I have to merge a single branch repeatedly?
A: Yes.
When you become tired of resolving identical conflicts,
enable git-rerere(1). The ‘rerere’ stands for Reuse Recorded
Resolution. It will help you to resolve conflicts that have been
resolved once before.
Q: May I use GitHub pull requests with gitworkflows?
A: Yes, of course.
For the git.git, GitHub pull requests are simply ignored but it’s
just a policy of the project.
“Merge Workflow” in the online manual gitworkflows(7) will
suit for GitHub users.
Thank you

Weitere ähnliche Inhalte

Kürzlich hochgeladen

Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...confluent
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)jennyeacort
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfAlina Yurenko
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...OnePlan Solutions
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceBrainSell Technologies
 
Sending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdfSending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdf31events.com
 
Cyber security and its impact on E commerce
Cyber security and its impact on E commerceCyber security and its impact on E commerce
Cyber security and its impact on E commercemanigoyal112
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsChristian Birchler
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesŁukasz Chruściel
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtimeandrehoraa
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureDinusha Kumarasiri
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfFerryKemperman
 
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdf
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdfInnovate and Collaborate- Harnessing the Power of Open Source Software.pdf
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdfYashikaSharma391629
 
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web DevelopmentVK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Developmentvyaparkranti
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprisepreethippts
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEEVICTOR MAESTRE RAMIREZ
 
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfStefano Stabellini
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Natan Silnitsky
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Mater
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalLionel Briand
 

Kürzlich hochgeladen (20)

Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
 
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
Call Us🔝>༒+91-9711147426⇛Call In girls karol bagh (Delhi)
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
 
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
Tech Tuesday - Mastering Time Management Unlock the Power of OnePlan's Timesh...
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. Salesforce
 
Sending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdfSending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdf
 
Cyber security and its impact on E commerce
Cyber security and its impact on E commerceCyber security and its impact on E commerce
Cyber security and its impact on E commerce
 
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving CarsSensoDat: Simulation-based Sensor Dataset of Self-driving Cars
SensoDat: Simulation-based Sensor Dataset of Self-driving Cars
 
Unveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New FeaturesUnveiling the Future: Sylius 2.0 New Features
Unveiling the Future: Sylius 2.0 New Features
 
SpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at RuntimeSpotFlow: Tracking Method Calls and States at Runtime
SpotFlow: Tracking Method Calls and States at Runtime
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
 
Introduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdfIntroduction Computer Science - Software Design.pdf
Introduction Computer Science - Software Design.pdf
 
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdf
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdfInnovate and Collaborate- Harnessing the Power of Open Source Software.pdf
Innovate and Collaborate- Harnessing the Power of Open Source Software.pdf
 
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web DevelopmentVK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Development
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprise
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdf
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
 
Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)Ahmed Motair CV April 2024 (Senior SW Developer)
Ahmed Motair CV April 2024 (Senior SW Developer)
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive Goal
 

Empfohlen

Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Applitools
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at WorkGetSmarter
 

Empfohlen (20)

Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
Unlocking the Power of ChatGPT and AI in Testing - A Real-World Look, present...
 
12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work12 Ways to Increase Your Influence at Work
12 Ways to Increase Your Influence at Work
 

The gitworkflows(7) illustrated

  • 2. What’s gitworkflows? A set of workflows used in the Git project itself. Details are described in the online manual gitworkflows(7) shipped with Git.
  • 3. Why gitworkflows? ● You can push -f for integration branches ● You can merge topic branches casually ● You can keep master stable with clear history ● Scalable to a large number of developers You know you can freely modify your commits and topic branches with Git. You can do it for integration branches with gitworkflows.
  • 4. In these slides I’ll show you how gitworkflows* work with simple commit graphs. It helps you to understand gitworkflows even though they are little complicated. Here we go. * Maybe slightly different from actual workflows used by git.git, because these slides are based on my interpretation of the gitworkflows(7).
  • 5. There is an initial commit. Let’s start from here.
  • 6. master This is the ‘master’ branch
  • 7. This is the ‘master’ branch
  • 8. Say you need three topics (A, B, C) for the first release. A B C
  • 11. No. ‘master’ can’t be reset after topics once merged (and pushed to public repositories). Use a ‘throw-away’ integration branch instead.
  • 12. ‘pu’ is the name of the throw-away integration branch. Stands for ‘Proposed Update’ pu
  • 13. ‘pu’ should be branched from the tip of the most advanced non-throw-away branch. ‘master’ would be fine at this time. (You may use git branch pu master)
  • 14. Merge topic A… (checkout pu and merge topic-A. You can use -- no-ff merge like below if you want) merge
  • 15. Merge topic A, B... merge
  • 16. Merge topic A, B and C into ‘pu’. merge
  • 17. Then, let’s do tests especially about interactions among the merged topics/features. (They can’t be tested on each branch)
  • 18. BTW you can push ‘pu’ to public repositories if needed. (push origin pu) e.g. a CI server is watching a public repository for running automated tests and you want to push for it.
  • 19. You may find some bugs/lacks of functionalities on ‘pu’ with integrated state of the three topics.
  • 20. One of them was introduced on topic A So fix it on that topic. commit
  • 21. Others should be added/fixed on each branch. commit
  • 22. And merge them into ‘pu’? No. ‘pu’ is a throw-away integration branch.
  • 23. So reset ‘pu’ to ‘master’ (checkout pu and reset --hard master) reset
  • 24. So reset ‘pu’ to ‘master’ so that throw away the old ‘pu’. (checkout pu and reset --hard master)
  • 25. And then, re-do merges... merge
  • 26. And then, re-do merges... merge
  • 27. And then, re-do merges... merge
  • 28. Now you’ve got new ‘pu’ that cleanly merged three topics.
  • 29. Note that all developers involved including you can’t work on ‘pu’. All topics have to be forked off from ‘master’
  • 30. Without reset, resulting branch / commit graph would be little more complicated, even though they have identical trees. trees of these two commits are identical - with reset - without reset
  • 31. OK. Let’s push new ‘pu’ to public repositories and test it.
  • 32. You have to do push -f origin pu or push origin +pu if you’ve pushed old ‘pu’ before, because new ‘pu’ isn’t direct descendant of the old ‘pu’ on origin.
  • 33. After test, you found that two features from topic A, B were good and stable but one from topic C wasn’t.
  • 34. You decide to merge topic A and B into ‘master’ because they are stable enough.
  • 35. Merge topic A… (checkout master and merge topic-A) merge
  • 36. Merge topic A and B into ‘master’. merge
  • 37. # Now topic A, B are not important any more for these slides. # So gray out them.
  • 38. At the same time, a bug on topic C was spotted and fixed. Let’s rebuild ‘pu’. commit
  • 39. ‘pu’ should be reset to ‘master’ again. (checkout pu and reset --hard master) reset
  • 40. Resetting ‘pu’ also means that throwing away the old ‘pu’.
  • 42. Merge topic C, then push ‘master’ and ‘pu’. Again, you have to use forced push for ‘pu’, so you may say: git push origin master +pu (prefix ‘+’ for the branch name means forced push.) merge
  • 43. You want more time to stabilize topic C. So you decide to make the first release with two features already merged into ‘master’.
  • 44. For making release, tag an annotated tag ( ) at ‘master’ tag
  • 45. v1.0.0 The release tag name is ‘v1.0.0’ Then push it. (tag -a ‘v1.0.0’ master and push origin v1. 0.0) tag
  • 47. You received new topics created after release. They would be branched from ‘master’. new topics
  • 48. Some new topics would be good but some are possibly not good (i.e. break something).
  • 49. So new topics should be merged into ‘pu’ first. merge
  • 50. Merge another topic into ‘pu’ and push it. merge
  • 51. You find two of three active topic branches look good after tests. But you are unsure for... Good Good
  • 52. Unsure for: - Stability of the implementation - Excellence of the design - Requirement of the feature etc.
  • 53. It means that keeping them in ‘pu’ is tiring because they won’t be changed for a while, but merging them into ‘master’ can’t be done because they may be changed or possibly deleted.
  • 54. In other words, you need an integration branch for stabilizing, testing or previews for those topics.
  • 55. ‘next’ is the integration branch for such use. It’s like a hybrid of throw-away and non throw-away. You can reset ‘next’ with an announcement for developers, but don’t do it so frequently. next tag
  • 56. ‘next’ will be branched from ‘master’. (branch next master)
  • 57. Merge the remaining old active topic, C… (checkout next and merge topic-C) merge
  • 58. And merge new one, say topic D. merge
  • 59. Here, ‘pu’ always should be branched from the most advanced non-throw-away integration branch.
  • 60. So let’s rebuild ‘pu’ on ‘next’ at this time. (checkout pu and reset --hard next) reset
  • 61. Old ‘pu’ will be deleted.
  • 63. Merge the remaining new topic, say topic E. merge
  • 64. Then, push ‘next’ and ‘pu’ (push origin next +pu)
  • 65. Note that you and developers involved cannot work on ‘next’ because it sometimes get reset. So all feature branches should be forked off from ‘master’
  • 66. What are the differences between ‘next’ and ‘pu’?
  • 67. ‘pu’ is easily disposable but ‘next’ isn’t.
  • 68. For example, if a topic merged only to ‘pu’ have a bug and fixed on it ... commit
  • 69. Then, simply reset ‘pu’ to ‘next’... (checkout pu and reset --hard next) reset
  • 70. And merge new tip of that topic. (i.e. rewind and reconstruct ‘pu’) merge
  • 71. On the other hand, if a topic kept in ‘next’ have another commit... commit
  • 72. ‘next’ can’t be reset, so just merge new tip of that topic on current ‘next’...
  • 74. And rebuild ‘pu’ on new ‘next’ reset and merge
  • 75. Note that you can merge the new branch head of topic D into ‘pu’ first if needed. (e.g. it has too large impact to merge into ‘next’) merge into ‘pu’ first (+ push and test) if it looks good, then merge into ‘next’ reconstruct ‘pu’. this is identical graph shown in previous page
  • 76. Here is another situation. You got new topic (say F).
  • 77. You found a topic kept in ‘pu’, topic E, was totally broken and the topic developer can’t fix it right away. When it happened, just reconstruct ‘pu’ ignoring broken branches. Broken
  • 79. And merge again only good branches. merge
  • 80. If the broken branch was rebased with fixes after a while... rebased rebased topic
  • 81. Merge the rebased new branch into ‘pu’ rebased merge
  • 82. If you find a branch kept in ‘next’, e.g. topic C, is broken and it can’t be fixed for a while... Broken
  • 83. You should revert the whole branch (revert -m 1 <merge commit>) revert revert commit reverted merge
  • 84. Of course you should rebuild ‘pu’ and push them. reset and merge
  • 85. After a while, when the topic C was fixed all bugs rebasing it... rebased
  • 86. Merge it into ‘next’... merge
  • 87. And rebuild ‘pu’, then push ‘next’ and ‘pu’. reset and merge
  • 88. Again, note that ‘next’ shouldn’t be reset easily like ‘pu’. When you want to redo something on ‘next’, just revert or re- merge instead.
  • 89. But ‘next’ can be reset with announcements for involved developers when it get awfully dirty with a number of revert and duplicate merges.
  • 90. And you’ll also have chances to reset ‘next’ after feature release. It will be shown later. Let’s keep developing for the second release for now.
  • 91. When you think topics merged into ‘next’ are stable / having good design / etc. you can merge them into ‘master’ Good enough to be merged into ‘master’
  • 92. When you think topics merged into ‘next’ are stable / having good design / etc. you can merge them into ‘master’ Good enough to be merged into ‘master’
  • 93. Repeat ‘pu’ -> ‘next’ -> ‘master’ cycle until enough features required for the next feature release are merged into ‘master’ new topic
  • 94. Repeat ‘pu’ -> ‘next’ -> ‘master’ cycle until enough features required for the next feature release are merged into ‘master’ merge
  • 95. Repeat ‘pu’ -> ‘next’ -> ‘master’ cycle until enough features required for the next feature release are merged into ‘master’ good enough for master
  • 96. Repeat ‘pu’ -> ‘next’ -> ‘master’ cycle until enough features required for the next feature release are merged into ‘master’ merge
  • 97. Repeat ‘pu’ -> ‘next’ -> ‘master’ cycle until enough features required for the next feature release are merged into ‘master’ good enough for next
  • 98. Repeat ‘pu’ -> ‘next’ -> ‘master’ cycle until enough features required for the next feature release are merged into ‘master’ merge reset and merge
  • 99. Repeat ‘pu’ -> ‘next’ -> ‘master’ cycle until enough features required for the next feature release are merged into ‘master’ new topic
  • 100. Repeat ‘pu’ -> ‘next’ -> ‘master’ cycle until enough features required for the next feature release are merged into ‘master’ merge
  • 101. Repeat ‘pu’ -> ‘next’ -> ‘master’ cycle until enough features required for the next feature release are merged into ‘master’ good enough for next
  • 102. Repeat ‘pu’ -> ‘next’ -> ‘master’ cycle until enough features required for the next feature release are merged into ‘master’ merge reset and merge
  • 103. These merges in ‘pu’ -> ‘next’ -> ‘master’ order, downstream-ward propagation of features, are called ‘graduate’.
  • 104. Unfortunately sometimes even topics merged into ‘master’ have bugs. Fix them on their topics? No. a bug found
  • 105. Once a topic merged into ‘master’, it will be regarded as ‘master’ itself. So fix branches should be created on ‘master’ for bugs of ‘master’. fix-branch for the bug
  • 106. Merge it into (‘pu’ and) ‘next’ first. merge reset and merge
  • 107. Then merge it into ‘master’ if it looks good. merge
  • 108. Note that you can merge the fix branch into ‘master’ directly when the commits in fix branch are trivial. fix-branch for the bug
  • 109. Note that you can merge the fix branch into ‘master’ directly when the commits in fix branch are trivial. merge
  • 110. But after that, don’t forget to merge ‘master’ into ‘next’ for the fix will be included in ‘next’ (‘next’ must have the bug because it has all topics merged into ‘master’) merge reset and merge
  • 111. There is another situation for fixing bugs. If the release v1.0.0 have a bug, how should we address it? a bug found
  • 112. Fix it on ‘master’ and let v1.0.0 users upgrade to ‘master’? But some v1.0.0 users don’t want to use new features merged into ‘master’.
  • 113. So you want a new integration branch only for bug fixing. ‘maint’ is such a branch. It will be branched from the latest feature release, i.e. v1.0.0. maint create branch
  • 114. The fix branch have to be branched from ‘maint’. Don’t branch from ‘master’ or any upstream. fix-branch for the bug
  • 115. If you branch the fix branch for ‘maint’ from ‘master’... *WRONG* fix-branch for the bug *WRONG*
  • 116. When the fix branch merged into ‘maint’, additional topics are also merged into ‘maint’. Those downwards merging will break ‘maint’ branch. *WRONG* merge *WRONG* unintentionally merged commits
  • 117. You can handle this case by cherry-pick the commit into ‘maint’, but you should take care where you fork off from. cherry-pick workaround
  • 118. So the fix branch should be forked off from ‘maint’. As a general rule, fork off topics from the oldest integration branch which the topics will be finally merged into. fix-branch for the bug
  • 119. Basically merge the fix branch for ‘maint’ into ‘next’ (or ‘pu’) first as usual because ‘maint’ never get reset. merge reset and merge
  • 120. Then merge it into ‘maint’ when it looks good on ‘next’. merge
  • 121. But...
  • 122. Of course you can merge fix branches directly into ‘maint’ when they are trivial. merge
  • 123. Sometimes you should merge ‘maint’ into ‘master’, and merge ‘master’ into ‘next’ for propagation of the fixes. Periodic upward merges are good habits.
  • 124. Sometimes you should merge ‘maint’ into ‘master’, and merge ‘master’ into ‘next’ for propagation of the fixes. Periodic upward merges are good habits. merge
  • 125. Sometimes you should merge ‘maint’ into ‘master’, and merge ‘master’ into ‘next’ for propagation of the fixes. Periodic upward merges are good habits.
  • 126. Sometimes you should merge ‘maint’ into ‘master’, and merge ‘master’ into ‘next’ for propagation of the fixes. Periodic upward merges are good habits. merge
  • 127. Sometimes you should merge ‘maint’ into ‘master’, and merge ‘master’ into ‘next’ for propagation of the fixes. Periodic upward merges are good habits. merge
  • 128. Sometimes you should merge ‘maint’ into ‘master’, and merge ‘master’ into ‘next’ for propagation of the fixes. Periodic upward merges are good habits. merge
  • 129. Sometimes you should merge ‘maint’ into ‘master’, and merge ‘master’ into ‘next’ for propagation of the fixes. Periodic upward merges are good habits. reset and merge
  • 130. Sometimes you should merge ‘maint’ into ‘master’, and merge ‘master’ into ‘next’ for propagation of the fixes. Periodic upward merges are good habits.
  • 131. When some fixes accumulated in ‘maint’, publish a fix- release.
  • 132. Tag v1.0.1 on ‘maint’ for the fix-release and push it. v1. 0.1 tag
  • 133. Well, after a while you want to make a new feature-release. And you want have a code-freeze period for this release.
  • 134. To freeze your code, just stop merging feature topics and only merge fix-topics, including ‘maint’, into ‘master’. merge fix branches only while frozen
  • 135. To freeze your code, just stop merging feature topics and only merge fix-topics, including ‘maint’, into ‘master’. fix fix feature
  • 136. To freeze your code, just stop merging feature topics and only merge fix-topics, including ‘maint’, into ‘master’. fix feature fix
  • 137. To freeze your code, just stop merging feature topics and only merge fix-topics, including ‘maint’, into ‘master’. fix feature merging maint is ok fix
  • 138. To freeze your code, just stop merging feature topics and only merge fix-topics, including ‘maint’, into ‘master’. fix feature merging fix branches are also ok fix
  • 139. To freeze your code, just stop merging feature topics and only merge fix-topics, including ‘maint’, into ‘master’. fix feature Don’t merge feature branches fix
  • 140. To freeze your code, just stop merging feature topics and only merge fix-topics, including ‘maint’, into ‘master’. fix feature Don’t merge feature branches fix
  • 141. To freeze your code, just stop merging feature topics and only merge fix-topics, including ‘maint’, into ‘master’. fix feature fix
  • 142. To freeze your code, just stop merging feature topics and only merge fix-topics, including ‘maint’, into ‘master’. fix feature fix even though good enough for master...
  • 143. To freeze your code, just stop merging feature topics and only merge fix-topics, including ‘maint’, into ‘master’. fix feature Don’t merge ANY feature branches fix
  • 144. To freeze your code, just stop merging feature topics and only merge fix-topics, including ‘maint’, into ‘master’. fix feature Don’t merge ANY feature branches fix
  • 145. To freeze your code, just stop merging feature topics and only merge fix-topics, including ‘maint’, into ‘master’. fix feature fix
  • 146. You can merge feature topics into ‘next’ for integration of them while ‘master’ is frozen. So you don’t have to stop developing for the code-freeze. merging feature branches are OKay fix feature fix
  • 147. You can merge feature topics into ‘next’ for integration of them while ‘master’ is frozen. So you don’t have to stop developing for the code-freeze. merging fix branches are also OKay fix feature fix
  • 148. You can merge feature topics into ‘next’ for integration of them while ‘master’ is frozen. So you don’t have to stop developing for the code-freeze.
  • 149. You can merge feature topics into ‘next’ for integration of them while ‘master’ is frozen. So you don’t have to stop developing for the code-freeze. rebase rebasing active topics are OKay
  • 150. You can merge feature topics into ‘next’ for integration of them while ‘master’ is frozen. So you don’t have to stop developing for the code-freeze. rebase rebasing active topics are OKay
  • 151. You can merge feature topics into ‘next’ for integration of them while ‘master’ is frozen. So you don’t have to stop developing for the code-freeze. reverting or dropping active branches are also OKay revert
  • 152. You can merge feature topics into ‘next’ for integration of them while ‘master’ is frozen. So you don’t have to stop developing for the code-freeze. reverting or dropping active branches are also OKay
  • 153. The code-freeze period has done. Now you will make feature-release.
  • 154. Before tagging, make sure ‘maint’ is fully merged into ‘master’ by git merge maint on ‘master’. If not merged, some fixes will be missing from the new release. Already fully merged into master in this case
  • 155. Now release it. Tag v1.1.0 on ‘master’ for the feature- release and push it. tag v1. 1.0
  • 156. New release has done. But you have some tasks for the ‘next’ and ‘maint’ after feature-release
  • 157. Let’s do for ‘next’. At first reset ‘next’ to ‘master’ reset to master leave a tag for in case messed up
  • 158. Then merge active topics they weren’t included in the last release. (And rebuild ‘pu’ if needed) merge active branches
  • 159. Then merge active topics they weren’t included in the last release. (And rebuild ‘pu’ if needed) merge active branches
  • 160. Then merge active topics they weren’t included in the last release. (And rebuild ‘pu’ if needed) check diff for making sure that they are equivalentdiff
  • 161. Then merge active topics they weren’t included in the last release. (And rebuild ‘pu’ if needed) rebuild pu
  • 162. This rewind and reconstruction of ‘next’ is for cleaning up the history of it. Actually you can do this anytime with an announcement. But it is good point to do this right after a feature release.
  • 163. This rewind and reconstruction of ‘next’ is for cleaning up the history of it. Actually you can do this anytime with an announcement. But it is good point to do this right after a feature release.
  • 164. Next, let’s see about ‘maint’ The task for ‘maint’ is simple. Just fast-forward ‘maint’ to ‘master’. Fast-Foward to master
  • 165. This is done by git merge --ff-only master on ‘maint’. If it fail, the last release is missing some fixes because ‘maint’ must have some commits that are not in ‘master’. Fast-Foward to master
  • 166. If you merge ‘maint’ into ‘master’ before the release like already shown, the fast-forward will succeed.
  • 167. Note that if you want keep maintenance branch for the previous feature-release, you can leave another maint branch, e.g. maint-1.0, for it. maint-1.0
  • 168. After the feature-release, repeat the same workflows already shown. This is the gitworkflows(7). Keep on developing with it. New topic and...
  • 169. Conclusion (1/2) ● Use throw-away integration branch like pu ● Merge topics into the throw-away(TA) first ● Test in TAs before merging topics into master ● You can use hybrid of TA and non-TA like next ● next can be reset with announcements. ● master and maint cannot be reset
  • 170. Conclusion (2/2) ● Don’t base your work on pu or next ● Fork off topics from the oldest integ-branch which the topics will be finally merged into ● Merge integration branches upwards ● Tag master for feature-releases ● Tag maint for fix-releases
  • 171. See also ● gitworkflows(7) ● Documentation/SubmittingPatches in Git source tree ● MaintNote in ‘todo’ branch of git.git ● the Git Blame blog by Junio C Hamano
  • 173. Q: What is the difference between next and pu? A: It depends. gitworkflows(7) saids pu, throw-away, is for testing the interaction of topics but according to the recent MaintNotes in the git.git, pu is a sort of reminder for the maintainer. next is said to be for testing/polishing for master in both documents. IMHO pu is a working space and next is a staging area for master. It looks like working tree and index of Git itself.
  • 174. Q: Do I have to keep {‘pu’, ‘next’, ‘maint’} A: No, you don’t. Just create and keep them if you need. But I recommend you to use a throw-away at least. You may keep it in your local repos only (i.e. make sure tests are succeeded and then push master). I’ve seen a project that have only ‘master’, ‘pu’ and another project that have ‘master’, ‘master-pu’, ‘maint’, ‘maint-pu’.
  • 175. Q: Do I have to keep so many topics? A: Yes. You have to keep them until they’ve been merged into ‘master’ or ‘maint’ But you can assign someone you trust to maintain a certain subsystem with gitworkflows. Then you can just merge his/her ‘master’ into your ‘master’. (actually you need a throw-away) This is the reason why gitworkflows is thought to be scalable.
  • 176. Q: Do I have to merge a single branch repeatedly? A: Yes. When you become tired of resolving identical conflicts, enable git-rerere(1). The ‘rerere’ stands for Reuse Recorded Resolution. It will help you to resolve conflicts that have been resolved once before.
  • 177. Q: May I use GitHub pull requests with gitworkflows? A: Yes, of course. For the git.git, GitHub pull requests are simply ignored but it’s just a policy of the project. “Merge Workflow” in the online manual gitworkflows(7) will suit for GitHub users.