+10

Add an option to prune local tags

Sebastien Matte 4 years ago 0

Since git 2.17.0 an option was added to git fetch to remove local tags that are not present on the remote server. 

https://git-scm.com/docs/git-fetch

This option is --prune-tags and should be used with --prune.

Unfortunately there is no option in SmartGit to use this feature. 


SmartGit only offers two related options:

  • "Prune obsolete remote tracked branches": this adds the --prune flag for branches ex:
    • git fetch --prune
  • "Update existing and fetch new tags": this call --force with the --tags option
    • git fetch --prune --no-tags
    • git fetch --tags --force

Using both options local tags will always remain after fetching from the server and the only way to prune is via command line.

This is a useful feature for the following scenario:

  1. UserA push tagA to origin
  2. UserB fetch tagA from origin
  3. UserA delete tagA from origin
  4. UserB fetch from origin, tagA stays on his local repository.
  5. UserB has no way using SmartGit to know that tagA was deleted. His next push will push tagA again.

Thank you