0
1

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】簡単にスタックブランチを管理する方法

Last updated at Posted at 2025-05-18

git-spiceを使用すると簡単にブランチをスタックできます。

インストール

Homebrewを使用する場合には以下のコマンドでインストールできます。

brew install git-spice

使い方

以下の順で実行するとブランチを作成し、変更をコミットします。

# ファイルに変更を加える
$ git add file.txt
$ gs branch create feat1

上記を繰り返してブランチをスタックします。

# ファイルに変更を加える
$ git add file2.txt
$ gs branch create feat2

リモートにブランチを反映するには以下のコマンドで認証します。

gs auth login

以下のコマンドでブランチをリモートに反映し、プルリクエストを開きます。

gs branch submit

プルリクエストに以下のようなコメントがつきます。

stack-comment.png

リモートの変更を反映するには以下のコマンドを実行します。

gs repo sync
0
1
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
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?