From: Jeff King Date: Wed, 20 Mar 2019 05:22:26 GMT Subject: Re: how can i "gc" or "prune" objects related to a deleted remote? Message-ID: <20190320052226.GA9650@sigill.intra.peff.net> In-Reply-To: <878sxbdx51.fsf@evledraar.gmail.com> On Tue, Mar 19, 2019 at 10:35:54AM +0100, Ævar Arnfjörð Bjarmason wrote: > > My guess is you forgot the tag? There's not a general solution there, > > because the tags all get intermingled. Git has no idea which ones came > > from which remote. However, if you have the commit id of an object you > > expect to be going away, you can use: > > > > git for-each-ref --contains=$that_commit > > Not a general solution, but if you know you have one remote left, and > you don't have unpushed locally created tags, you can do a: > > git fetch origin --prune --prune-tags Good call. I forgot that we even had --prune-tags. -Peff