git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: how can i "gc" or "prune" objects related to a deleted remote?

From
Jeff King <peff@peff.net>
Date
Mar 20, 2019, 05:22 UTC
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:
Show 11 quoted lines
> > 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
Previous: Ævar Arnfjörð Bjarmason
Message 4 of 4 in “how can i "gc" or "prune" objects related to a deleted remote?”
  1. Robert P. J. DayMar 8, 2019
  2. Jeff KingMar 19, 2019
  3. Ævar Arnfjörð BjarmasonMar 19, 2019
  4. Jeff KingMar 20, 2019

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.