Version Control (Part1-Part.11) [Git] articles are available on Amazon kindle Unlimited (e-book).
howahowablog.com will only be able to read Part.5/10/11.
Version Control (Parts 12-21) [GitHub (Part 1)] articles are available on Amazon kindle Unlimited (e-book).
Only part15/19 will be available on howahowablog.com.
Version Control (Part 21-Part.30) [GitHub (Part 2)] articles are available on Amazon kindle Unlimited (e-book).
Only Part.24/30 will be available on howahowablog.com.
Objectives of Chapter 8
Understand the design and operation of branches.
Understand the “main (master) branch” and “develop branch”.
Understand the “feature branch”, “release branch” and “hotfix branch”.
Design and operational considerations for Git branches
Design and operational considerations for Git branches
Git is a tool for individuals to create multiple repositories in their local environment and switch between them flexibly to develop systems.
However, when collaborative development is carried out, it is necessary to unify operational methods, such as granularity and methodology, to some extent.
By using these, you can expect to reduce problems and losses that occur in your work.
Main and Support branches of “git-flow”
Main and Support branches of “git-flow”
In operations using “git-flow”, a “main branch” and a “support branch” are prepared for development.
- Main branch…This is a branch for storage. It must not be deleted. No development takes place in this branch, but edits made in the support branch will be merged.
- Support branch…This is a branch used for development and bug fixing derived from the main branch. It is deleted after the merge.
Main branch of “git-flow”
main branch (master branch)
A branch where there is always a stable version of the software (program). Branches under development are never merged. (Equivalent to a stable version, but may contain a mixture of bugs and other problems.)
The “Main branch” in git-flow is the “main branch”, which is prepared from the beginning in a directory under Git control, and the “develop branch”, which is derived from the “main branch”. These two branches are not used for development.
For development, use the “feature branch” derived from the “develop branch” and edit the program in this “feature branch”.
When you have finished editing in the “feature branch”, merge the changes into the “develop branch”. In addition, a “release branch” will be derived from the “develop branch” to edit bugs that could not be removed in the “feature branch”.
When you have finished editing on the “release branch”, merge it into both the “develop branch” and the “main branch”.
“The feature branch” and “the release branch” are “support branches”.
If a bug or other problem occurs in the running system that needs to be fixed, create a “hotfix branch” from the “main branch”, edit it, and merge it back into the “main branch”. These are brief descriptions of each branch.
The “main branch” is only merged from the “release” and “hotfix” branches of the support branches. The “feature branch” of the support branches is basically only merged into the “develop branch”.
【English translation in illustration】
他のブランチからのマージ → Merging from other branches
メインブランチ → Main branch
サポートブランチ → Support branch
develop branch
This is the branch where the stable version of the software is present, with minor updates completed.
This branch is also not merged with the branch under development. This branch is derived from the main branch.
(The develop branch also corresponds to the stable version, but it may contain bugs.)
【English translation in illustration】
他のブランチからのマージ → Merging from other branches
メインブランチ → Main branch
サポートブランチ → Support branch
Support branch of “git-flow”
feature branch
This branch is used when developing new features. Unplanned development does not take place in this branch. This branch is derived from the “develop branch” and merged into the “develop branch”. After the merge, the “feature branch” is deleted.
【English translation in illustration】
派生とマージ → Derivation and merging
メインブランチ → Main branch
サポートブランチ → Support branch
release branch
This is derived from the “develop branch”, where development has finished in the “feature branch” and the merging process has been completed.
From here onwards, bug fixes that could not be removed in the feature branch and version numbers are updated for release.
When the work is finished, merge it into both the “main branch” and the “develop branch” and delete the “release branch”.
【English translation in illustration】
派生とマージ → Derivation and merging
メインブランチ → Main branch
サポートブランチ → Support branch
hotfix branch
This branch is used to fix bugs, etc., if they exist in the system that is currently in operation.
As the system is currently running, it is derived from the main branch.
When the work is finished, it is merged into both the “main branch ” and the “develop branch ” and the “hotfix branch ” is deleted.
【English translation in illustration】
派生とマージ → Derivation and merging
メインブランチ → Main branch
サポートブランチ → Support branch
That’s all for this article.
ブックマークのすすめ
「ほわほわぶろぐ」を常に検索するのが面倒だという方はブックマークをお勧めします。ブックマークの設定は別記事にて掲載しています。