LoginSignup
317
279

More than 5 years have passed since last update.

削除されたremoteブランチがローカルのRepoに残っていて、それを削除する方法

Last updated at Posted at 2012-12-26

複数人で作業しているとき、自分以外の誰かがremoteブランチを削除したのが自分のローカル環境に反映されないことがあると思うんですが、下のコマンドを実行してやればキレイにできます。

# remoteブランチを単純参照
git remote show origin

# remoteブランチでは削除されているが、ローカルに参照が残っているブランチを表示
git remote prune --dry-run origin

# すでに削除されているremoteブランチのローカル参照を削除してきれいにする
git remote prune origin
317
279
1

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
317
279