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 create--below オプションで新しいブランチを現在のブランチの下に作成できます。

gs branch create ブランチ名 --below

     ┌── C
   ┌─┴ B
 ┌─┴ A ◀ (current)
trunk

同じ初期状態で gs branch create X --below を実行すると

      ┌── C
    ┌─┴ B
  ┌─┴ A
┌─┴ X
trunk

新しいブランチXがAの下(trunkとAの間)に作成されます。

--target オプションとの組み合わせ

--target オプションと組み合わせることで、現在のブランチ以外を基準にした挿入も可能です。

# ブランチBを基準として、その下に挿入
gs branch create X --below --target B

初期状態

     ┌── C
   ┌─┴ B
 ┌─┴ A ◀ (current)
trunk

gs branch create X --below --target B

      ┌── C
    ┌─┴ B
  ┌─┴ X
┌─┴ A
trunk
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?