08-Git&GitHUb

Version Control Git (Part.12~Part.21)[GitHub(Part.19)]|How Branches Operate in Collaborative Editing

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.

The team must clarify which git branch and what work is to be performed and decide who is to perform the merging work and when.

Uncoordinated work leads to many problems and lost work time.

Git has a branching model called ‘git-flow’, and there are ‘git-flow’ plugins and other plugins that follow this model.

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.

  1. 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.
  2. 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

※Merging from the main branch to other branches is generally not performed.

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

※The “develop branch” is the branch with the latest state of team development.

※The “main” and “develop” branches do not merge with each other.

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.

「Git・GitHub」おすすめ書籍6選+α【初心者用4冊&実践用2冊&番外編1冊】| 現役エンジニア&プログラミングスクール講師「Git・GitHub」初心者の方がGitの操作を理解するためのお勧めの書籍について取り上げています。また中級者の方が更に進んだ学習ができる実践的な書籍についてお勧めできる2冊を取り上げています。ページの下部には「おすすめのITスクール情報」「おすすめ求人サイト」について情報を掲載中。...

ブックマークのすすめ

「ほわほわぶろぐ」を常に検索するのが面倒だという方はブックマークをお勧めします。ブックマークの設定は別記事にて掲載しています。

「お気に入り」の登録・削除方法【Google Chrome / Microsoft Edge】| 現役エンジニア&プログラミングスクール講師「お気に入り」の登録・削除方法【Google Chrome / Microsoft Edge】について解説している記事です。削除方法も掲載しています。...
【パソコン選び】失敗しないための重要ポイント | 現役エンジニア&プログラミングスクール講師【パソコン選び】失敗しないための重要ポイントについての記事です。パソコンのタイプと購入時に検討すべき点・家電量販店で見かけるCPUの見方・購入者が必要とするメモリ容量・HDDとSSDについて・ディスプレイの種類・バッテリーの持ち時間や保証・Officeソフト・ウィルス対策ソフトについて書いています。...
RELATED POST
08-Git&GitHUb

バージョン管理【Git と GitHub】まとめ|現役エンジニア&プログラミングスクール講師

2023年6月5日
プログラミング学習 おすすめ書籍情報発信 パソコン初心者 エンジニア希望者 新人エンジニア IT業界への就職・転職希望者 サポートサイト Programming learning Recommended schools Recommended books Information dissemination Computer beginners Prospective engineers New engineers Prospective job seekers in the IT industry Support site
08-Git&GitHUb

バージョン管理(Part.12~Part.21)【GitHub(Part.15)】|ローカルリポジトリとリモートリポジトリの同期 | 現役エンジニア&プログラミングスクール講師

2024年1月31日
プログラミング学習 おすすめ書籍情報発信 パソコン初心者 エンジニア希望者 新人エンジニア IT業界への就職・転職希望者 サポートサイト Programming learning Recommended schools Recommended books Information dissemination Computer beginners Prospective engineers New engineers Prospective job seekers in the IT industry Support site
08-Git&GitHUb

Version Control Git (Part1-Part.11) [Git (Part.11)]|Setting ".gitignore" and ".gitignore_global" (setting files not to be managed by Git)

2024年4月4日
プログラミング学習 おすすめ書籍情報発信 パソコン初心者 エンジニア希望者 新人エンジニア IT業界への就職・転職希望者 サポートサイト Programming learning Recommended schools Recommended books Information dissemination Computer beginners Prospective engineers New engineers Prospective job seekers in the IT industry Support site
08-Git&GitHUb

Version Control Git (Part.22~Part.30)[GitHub(Part.24)]|Pull requests (re-requests)

2024年5月23日
プログラミング学習 おすすめ書籍情報発信 パソコン初心者 エンジニア希望者 新人エンジニア IT業界への就職・転職希望者 サポートサイト Programming learning Recommended schools Recommended books Information dissemination Computer beginners Prospective engineers New engineers Prospective job seekers in the IT industry Support site
08-Git&GitHUb

バージョン管理(Part.12~Part.21)【GitHub(Part.19)】|共同編集で気を付けるブランチ運用 | 現役エンジニア&プログラミングスクール講師

2024年1月31日
プログラミング学習 おすすめ書籍情報発信 パソコン初心者 エンジニア希望者 新人エンジニア IT業界への就職・転職希望者 サポートサイト Programming learning Recommended schools Recommended books Information dissemination Computer beginners Prospective engineers New engineers Prospective job seekers in the IT industry Support site
08-Git&GitHUb

「Git・GitHub」おすすめ書籍6選+α【初心者用4冊&実践用2冊&番外編1冊】| 現役エンジニア&プログラミングスクール講師

2024年7月7日
プログラミング学習 おすすめ書籍情報発信 パソコン初心者 エンジニア希望者 新人エンジニア IT業界への就職・転職希望者 サポートサイト Programming learning Recommended schools Recommended books Information dissemination Computer beginners Prospective engineers New engineers Prospective job seekers in the IT industry Support site