以下の理由で、Gitリポジトリをつくったあとの最初のコミットを空コミットにしておきたい
- 新しいfeatureブランチが存在する
- プルリクをビルドのトリガーにしたい
いまままで調べていたのをすぐ忘れるのでオプションをメモするのと、そもそもドキュメントを読んでなかったので読んでみる
ドキュメントは以下 git-scm.com
--allow-empty
Usually recording a commit that has the exact same tree as its sole parent commit is a mistake, and the command prevents you from making such a commit. This option bypasses the safety, and is primarily for use by foreign SCM interface scripts.
親コミットとまったく同じツリーを持つコミットを記録(空コミット)は間違いなので、通常はできないようになっているが、それを安全に処理するオプションで、主に外部のSCMと統合のために使うものらしい
空コミットは基本最初だけにとどめておく