I'm trying to use IntelliJ to delete some tags from Git remote.
However, this always fails and I cannot get rid of them
These are the logs
08:39:08.636: [my-project] git -c credential.helper= -c core.quotepath=false -c log.showSignature=false fetch origin --recurse-submodules=no --progress --prune
From https://github.com/my-organization/my-project
* [new tag] my-tag--0.1.4 -> my-tag--0.1.4
08:40:54.900: [my-project] git -c credential.helper= -c core.quotepath=false -c log.showSignature=false tag -d my-tag--0.1.1
08:41:00.047: [my-project] git -c credential.helper= -c core.quotepath=false -c log.showSignature=false push --progress --porcelain origin :refs/tags/my-tag--0.1.1 --force-with-lease=refs/tags/my-tag--0.1.1:e7bd8bbdf2eee670782e0e0bb19fe3df6793dec9
error: failed to push some refs to 'https://github.com/my-organization/my-project.git'
To https://github.com/my-organization/my-project.git
! (delete):refs/tags/my-tag--0.1.1 [rejected] (stale info)
Done
It seems, the tag that is rejected is not the tag I'm trying to delete (0.1.4 vs 0.1.1).
Is anyone else facing this problem and how to get rid of it?
CodePudding user response:
Whenever I see a "stale info", I start with a git fetch
, in order to update any remote tracking data stored in the local repository.
In your case: git fetch --prune
to clean up local references which are no longer in the remote repository.
But a fetch from IntelliJ IDEA seems to always use --prune
anyway.
The remote tag might have been moved or deleted since you last fetched.
Then you can try a push for deleting your tag.
CodePudding user response:
Try force-pushing the tag from the Command line using plain git push --force
. IntelliJ uses --force-with-lease
, which appears to prevent force-pushing tags.