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?

【git-spice】コミットを一つにまとめる方法

Posted at

gs branch squashコマンドを使用すると、現在のブランチのすべてのコミットを1つのコミットにスカッシュし、上位ブランチ(upstack branches)を自動的にリスタックできます。

使用方法

gs branch squash [flags]
# またはさらに短い省略形
gs b sq [flags]

現在のブランチのすべてのコミットを1つにまとめます。

gs branch squash

コマンドを実行するとエディタが開き、スカッシュされたコミットのメッセージを編集できます。その後、上位ブランチが自動的にリスタックされます。

コミットメッセージを直接指定

-mまたは--messageフラグを使用して、エディタを開かずにコミットメッセージを直接指定できます。

gs branch squash -m "機能Aの実装完了"

フックをバイパス

--no-verifyフラグを使用して、pre-commitおよびcommit-msgフックをバイパスできます。

gs branch squash --no-verify -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

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?