How can one remove unused git bracnhes from Tortoise-Git? These branches have been removed both locally and remotely, i'd like to not see them anymore when using this dropdown
-
I think this has been asked here: https://stackoverflow.com/questions/19928808/deleted-remote-branches-still-listed-in-tortoisegit and that answer is pretty good. – joe_flash Feb 01 '18 at 17:23
4 Answers
As of TortoiseGit 2.4.0.2 there is a way to let it execute git remote prune origin
. In the Sync window you can select "Clean up stale remote branches" which then will remove all already removed remote branches from your local cache.
I don't know if this already exists in previous versions, because I normally use the command line ^^

- 171
- 1
- 3
- 11
-
perfect! this is the option on the tortoisegit. no command line required. – polras Sep 02 '17 at 19:46
-
-
1I almost exclusively use the git log view of TortoiseGit, as I can do everything I need to and see the entire state of the repo from this one view. From the fetch dialog there is a "Prune" checkbox as well that if checked appears to do the exact same thing. This answer led me to discover this. – Barak Gall Jan 28 '19 at 21:23
-
1
You need to run git remote prune origin
. This will get rid of remote tracking branches which no longer represent a branch on the remote.

- 124,556
- 26
- 146
- 141
-
Does not remove it from Tortoise-Git. Is there anything specific i need to do for this application? – James Raitsev Jan 04 '12 at 23:33
-
when you run `git branch -a` do you see those branches (with or without origin)? – Adam Dymitruk Jan 05 '12 at 00:07
-
Adam - both locally and remotely i see only branches i need to see. Noise that shows up on top is not present – James Raitsev Jan 05 '12 at 14:44
-
Are you looking at a different repository possibly? What does .git/refs contain? – Adam Dymitruk Jan 06 '12 at 05:19
You can do 'view log' and then scroll down to where you see the branch marker, right-click and ask to delete it. Typically you will see it twice as foo and origin/foo and you may want to delete both.
I have not found a way to do the equivalent of git remote prune origin
from the TortoiseGit GUI.

- 1,350
- 17
- 36
Maybe you just pruned/removed the branches and the cache is not up-to-date. You could kill the tgitcache.exe
process to reset the cache.

- 536
- 2
- 4
-
Killing (and later restarting) this process does not reset cached entries – James Raitsev Jan 05 '12 at 14:42