Git:ブランチ
履歴の流れを分岐して記録していくためのもの。
分岐したブランチは他のブランチの影響を受けないため、同じリポジトリ中で複数の変更を同時に進めていくことができる。
Gitでは、ブランチに3種類ある。
ローカルブランチ(local branch)
リモートブランチ(remote branch)
リモートトラッキングブランチ(remote tracking branch)
ブランチを作る目的(例)
実験的な変更のため
新しい機能の追加のため
バグフィックスのため
code:branch.mermaid
%%{init:{
'gitGraph':{
'showBranches': true
}}}%%
gitGraph
commit
commit
branch develop
checkout develop
commit
branch feature_1
checkout feature_1
commit
checkout develop
checkout feature_1
commit
checkout develop
merge feature_1
commit
commit
checkout main
commit
commit
ブランチ(branch)
Git:branch
Git:チェックアウト - チェックアウト(checkout)
Git:マージ - マージ(merge)
Git:リベース - リベース(rebase)
Git:コミット - コミット(commit)
git branch -- ブランチ情報の表示およびブランチの作成
git checkout -- ブランチの切り替え
git init -- リポジトリを作成する
git commit -- 変更点をコミットする
Git-term.icon
https://img.shields.io/badge/git-ブランチ-F05033.svg?style=for-the-badge&logo=git&logoColor=white