Community
Participate
Working Groups
Let’s say I have the following fetch specification: remote.origin.fetch +refs/heads/*:refs/remotes/origin/* Now a new branch gets created in the central repository. If I do a fetch I will get a new remote tracking branch for this new branch in the central repository. If I now delete the branch in the central repository and fetch again, the obsolete remote tracking is not deleted. As default behaviour this is ok, since it does the same as git fetch on the command line. For fetch on the command line you have the option --prune which would remove the obsolete remote tracking branch. It would be nice to have this option in EGit too. It could be an option on the fetch specification or a global EGit preference (if the fetch configuration dialog should not be spoiled with too many options).
(In reply to comment #0) > As default behaviour this is ok, since it does the same as git fetch on the > command line. For fetch on the command line you have the option --prune which > would remove the obsolete remote tracking branch. It would be nice to have this > option in EGit too. It could be an option on the fetch specification or a > global EGit preference (if the fetch configuration dialog should not be spoiled > with too many options). +1. I just spent quite a bit of time wondering why I am seeing obsolete branches in JDT/Core repository on my machine. I would like to be able to 'completely replicate' a remote canonical repository on my machine, and I think that this should be the default behavior.
This is fixed in the upcoming 3.3 release of EGit. You can add a "fetch.prune" or a "remote.<yourremotename>.prune" key to the gitconfig and set it to "true". When you fetch, this will automatically prune branches that are deleted on the central repository.
fixed by https://git.eclipse.org/r/#/c/21845/ https://git.eclipse.org/r/#/c/21957/