infoMore than 3 years have passed since last update.
git ローカルでのブランチの基本操作
Last updated at Posted at 2021-08-23
ローカルブランチの基本操作
ローカルリポジトリまで移動
ブランチを確認
* 現在のブランチを確認
* git branch
* ブランチ一覧を表示
* git branch -a
ブランチの作成
git branch ブランチ名 派生元のブランチ名
ブランチの切り替え
git switch ブランチ名
(git checkout でも同じ挙動だが現在は、`git switch` を推奨)
ブランチの作成と切り替えを一緒に行う
git switch -c ブランチ名 派生元のブランチ名
マージする
1.操作したいブランチに切り替え
git switch ブランチ名
2.マージして取り込む
git merge マージ対称ブランチ
ブランチを削除
0Go to list of users who liked
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme
What you can do with signing up