LoginSignup
0
0

More than 1 year has passed since last update.

[Git] git-flowの使い方

Last updated at Posted at 2021-10-15

前回、git-flowの概要と各ブランチの役割について紹介した。今回は、git-flowの使い方(コマンド)について紹介する。

git-flowの使い方

git-flowのコマンドは基本的には次の書式になる。

git flow <ブランチの種類> <コマンド>

■ ブランチの作成

新たなブランチを作成する場合

git flow <ブランチの種類> start <ブランチ名>

■ ブランチの共有

作成したブランチを共有リポジトリで共有する場合

git flow <ブランチの種類> publish <ブランチ名>

■ ブランチの取得

共有リポジトリからブランチを取得する場合

git flow <ブランチの種類> track <ブランチ名>

■ コミットの取得

共有リポジトリ上のコミットを取得する場合

git flow <ブランチの種類> pull origin

■ ブランチの終了

共有リポジトリからブランチを取得する場合

git flow <ブランチの種類> finish <ブランチ名>

ブランチ終了後、終了したブランチは削除される。

まとめ

紹介したコマンドを表にまとめると以下となる。

コマンド 操作
start  ブランチの作成
publish  ブランチを共有リポジトリで共有
track  共有リポジトリからブランチを取得
pull  共有リポジトリ上のコミットを取得
finish  developかdevelopとmasterへマージして、ブランチを削除
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0