何も変更をしていないけれども、コミットをしたいことありますよね!
私はあります。
PaaS(Platform as a Service)のアレをナニするときですよ。
これ以上は言いますまい。
git commit --allow-empty -m "empty commit"
これです。
ヘルプ
--allow-empty
とはどういう意味なのかを調べてみます。
git help commit
上記のコマンドを実行して出てきたヘルプの中から、--allow-empty
を抜粋しておきます。
--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.
記事にした背景
git commit --allow-empty -m "empty commit"
上記を私は覚えられません。
アウトプットをすることで脳が大事なことだと記憶してくれるんです。
elixir.jpというSlackワークスペースの#autoracex
というチャンネルで、以前の私の書き込みが役に立ったよ〜 という方がいらっしゃっいました。
それで他の方の役に立つことがあるかもしれないとおもいまして、記事にしておきました。
自分自身の記憶のためと、まだ知らないあなたのために書いています。
つまりは
$\huge{愛💜}$
です。
この記事は
Advent Calendar 2022 58日目1の記事です。
I'm looking forward to 12/25,2022
私のAdvent Calendar 2022 一覧。
次回もお楽しみに〜。
花の色はうつりにけりないたづらにわが身世にふるながめせしまに