by shigemk2

当面は技術的なことしか書かない

git remote prune originって何?そもそもpruneって何よ?

$ man git-prune

を実行すると、以下のような説明がある。

This runs git fsck --unreachable using all the refs available in refs/, optionally with additional set of objects specified on the command line, and prunes all unpacked objects
unreachable from any of these head objects from the object database. In addition, it prunes the unpacked objects that are also found in packs by running git prune-packed.

この説明で全部分かるならそれでいいと思うけど、実際どういうことなのか分からないよ。

まず、

$ git remote show origin

git remote show origin リモート上の削除されたブランチがあるかどうか確認する方法とのことです。

また、リモート上の削除されたブランチをローカルから消す場合は、

$ git remote prune origin

を実行するとよい。
Gitでリモートの共有リポジトリにあるブランチを消す時のメ - a long log

git remote prune originをやらないと、リモートブランチを消しても
git branch -a に出てくる。
Gitでリモートブランチを消してもgit branch -aに出てくる件 - chulip.org