`! [rejected] v1.2.0 -> v1.2.0 (already exists)` when pushing a tag.
IntermediateTroubleshootingPush, Pull and Fetch Errors
Answer
Likely causes → A tag with that name exists on the remote pointing to a different commit.
Diagnose →
git ls-remote --tags origin v1.2.0
git rev-parse v1.2.0^{}
Fix → If the remote tag is correct, fetch it (git fetch origin tag v1.2.0) and stop. If you really need to move it and nobody consumed it, git push origin :refs/tags/v1.2.0 then re-push. Otherwise use a new version.
Prevent → Make tags immutable with a tag ruleset, and let CI create release tags.
More on Push, Pull and Fetch Errors
`! [rejected] main -> main (fetch first)` / `(non-fast-forward)`Beginner`remote: error: GH006: Protected branch update failed for refs/heads/main.`Intermediate`! [rejected] feature -> feature (stale info)` with `--force-with-lease`.Intermediate`You are not currently on a branch.` when running `git pull` or `git push`.Beginner`There is no tracking information for the current branch.` when running `git pull`.Beginner`fatal: The current branch feature has no upstream branch.` on `git push`.Beginner