0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

Git Flowでnon-fast-forwardでマージする

Last updated at Posted at 2022-01-30

はじめに

私は普段、SourceTreeでGit Flowを使っていますが、Featureブランチを完了時にマージはデフォルトでファストフォワードになっています。
SourceTreeでGitの設定をマージ時にファストフォワードせずに、常に新規コミットを作成するにチェックを入れても、ファストフォワードになってしまいます。
そこで今回はGit FlowでFeatureを完了するときにノンファストフォワードでマージする方法を紹介します。

.gitconfigに追加する

git configコマンドで.gitconfigにno-ffを追加します。

git config --global --add gitflow.feature.finish.no-ff true
.gitconfig
[gitflow "feature.finish"]
no-ff = true

通常のマージの

.gitconfig
[merge]
ff = false

とは値が逆になっていますので気を付けてください。

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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?