0
1

More than 1 year has passed since last update.

Git flow の手順備忘録

Posted at

本記事の目的

  • Git flow でブランチ管理を簡略化しているものの,慣れないうちやしばらく触っていないと「どんな順番でコマンド叩いてたっけ...」となり,何度も調べ直すので,自分用に手順の備忘録を残す

前提

  • remotes/origin は Github へ
  • master ブランチ上では直接作業をしない
    • 微修正は develop ブランチで作業
    • 大きな修正は feature ブランチで作業
      • いくつか並列しても OK
    • リリースに際した調整は release ブランチで作業
      • バージョン管理,メタデータ修正,他
    • 直ちに修正すべき簡易バグは hotfixes ブランチで作業
  • リリース作業は個人で行う(途中で push/pull しない)
    (実際の IT 現場でどうしているのかは知見がありません...)

手っ取り早く結論

feature ブランチの作成から develop ブランチへのマージまで

## Initialization
$ git pull origin
$ git flow feature start FEATURE_NAME

## Add the feature branch to the remote
$ git flow feature publish FEATURE_NAME

## Save changes and push to the remote
$ git commit -am "Some comments"
$ git push

## Pull from the remote and rebase
$ git flow feature pull
$ git flow feature rebase

## Finish changes
$ git flow feature finish FEATURE_NAME
$ git push
$ git fetch -p

release ブランチの作成から develop, master ブランチへのマージまで

## Initialization
$ git flow release start VERSION_NUMBER

## Save minor changes
$ git commit -am "Some comments"

## Finish changes
$ git flow release finish FEATURE_NAME
$ git push

## Fetch the latest remote branches
$ git fetch -p

hotfixes も同様.

参考

Git-flow の図解

Git-flow の公式見解

0
1
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
1