0

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.?

J. Chomel
  • 8,193
  • 15
  • 41
  • 69

2 Answers2

1

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.

MrTux
  • 32,350
  • 30
  • 109
  • 146
  • Oh... This is what "prune" was meant for. Always thought the thing was enable at the time I fetched. But it wasn't! it was using the default. Great Mr. TUx. – J. Chomel Aug 25 '20 at 12:18
0

The TortoiseGit solution suggested above works well.

I also found a "plain git command" solution:

  • remove the reference file
  • force git to re-create it.

mv .git/packed-refs .git/packed-refs-bak
git fetch
git pack-refs --all
J. Chomel
  • 8,193
  • 15
  • 41
  • 69