0
0

More than 1 year has passed since last update.

Git 差分の無いブランチにコミットする方法

Posted at

いわゆる空コミットの方法
※ 複数人が関わるブランチの場合は運用ルール等を事前に確認してからやりましょう

手順

  1. 空コミットしたいブランチに切り替え
  2. 以下コマンドを実行
    git commit --allow-empty -m "[コメント]"

コメントには空コミットを行った理由(「初回コミット」とか)を残しておくと良いです

何に使うん?

  • 新しく作ったブランチの最初のコミットに
  • プルリクを送りたい時に
  • 他開発・保守作業上必要な場合に
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