0
1

リモートブランチにpushしたけどやっぱりブランチ名変えたい!

Posted at

ブランチ名の変更手順

  1. 現在のブランチが 対象のブランチ であることを確認

    git branch
    

    もし他のブランチにいる場合は、対象のブランチに切り替えます。

    git checkout 対象のブランチ名
    
  2. ローカルで対象のブランチを新しいブランチ名に変更

    git branch -m 新しいブランチ名
    
  3. リモートリポジトリの古いブランチ名を削除し、新しいブランチ名をプッシュ

    git push origin --delete 古いブランチ名
    git push origin 新しいブランチ名
    
  4. リモートリポジトリでトラッキングを設定

    git push --set-upstream origin 新しいブランチ名
    

EOF

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