LoginSignup
0
1

More than 1 year has passed since last update.

【Git】ブランチ名を変更する方法

Posted at

ローカルブランチ

ローカルブランチのブランチ名を変更するには次のコマンドを実行します。

git branch -m 旧ブランチ名 新ブランチ名

カレントブランチの名前を変更する場合には次のように実行します。

$ git branch -m 新ブランチ名

リモートブランチ

リモートブランチ名を変更する場合には次の手順でコマンドを実行します。

$ git branch -m 古いブランチ名 新しいブランチ名
$ git push -u origin HEAD
$ git push origin リモートブランチ名
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