11
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

残ってしまうリモート追跡ブランチを一括削除する方法[コマンド・SourceTree]

Last updated at Posted at 2019-10-31

Gitの基礎だと思いますが、備忘録として残します。

merge済みのRemoteのブランチを削除していたとしても、ローカルには残っています。
(SourceTreeで言うと、REMOTESの中にたくさん残ってしまいますね)

それを一つ一つ削除するのも面倒だったのでコマンドで…

git fetch -p

-p-pruneの略で、
「取得後、リモートに存在しなくなったリモート追跡ブランチを削除します」
と説明されていました。

まさに欲しかった機能です。

と、ここまで書いて、念の為にSourceTreeをチェックしたところ、
同一機能がきちんとありました。

メニューのRepository -> Fetch
で上から2番目のチェックを入れれば良さそうです。
スクリーンショット 2019-10-31 11.30.04.png

ありがとうございました。

参考

11
8
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
11
8

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?