LoginSignup
1
1

More than 5 years have passed since last update.

リモートの 特定の git ブランチのみを削除したい(ローカルはそのままにしたい) 所要時間 1分

Last updated at Posted at 2015-05-29

プルリクを投げるつもりでブランチをpushしてしまったけど、コミットがミスっていた。というパターン。
リモートのブランチだけ消してしまったほうが楽なことが多い

  • リモートを origin で指定しているとすると
$ git push origin :(消したいブランチ名)

これで、ローカルのブランチはそのままで、リモートだけ消える。

あとはローカルのコミットログを
git reset --soft なりして修正して
再度ブランチをpushすればよい

1
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
1
1