Search code examples
gitperformancetortoisegit

Clean large pack-refs after many branches where "archived"


I recently "archived" (created archive/tag and removed branch - following How can I archive git branches?) a large set of branches.

However, this did not solved one of my issues, which was the large number of lines I had to scroll through in when performing some action (here: merge: tortoisegit lots of refs.

I see all these branches in Tortoise, even if they do not show locally or remotely with the git branch -a command:

Question

How is it possible to reset this set of references without having to clone the entire repo.?


Solution

  • In order to clean up remote tracked references which are deleted on the remote side perform a fetch with prune (cf. https://tortoisegit.org/docs/tortoisegit/tgit-dug-pull.html)

    FYI: TortoiseGit executes git.exe for-each-ref to list all references, so they are still there in the repository.