How to Fix Git Error: 'Updates were rejected because the tag already exists in the remote'

beginnerπŸ“¦ Git2026-07-14| This error occurs in any Git-managed environment (Linux, macOS, Windows) when using CLI or GUI tools like GitKraken, VS Code, or Sourcetree during a push operation.

Error Message

error: failed to push some refs to '...'. Updates were rejected because the tag already exists in the remote.
#git#devops#version-control#git-error#deployment

Why Git is Blocking Your PushGit tags act as permanent milestones in your project history, usually marking specific releases like v1.0.0 or v2.4.5-beta. This error pops up when you try to push a tag to a server (like GitHub or GitLab) that already has a tag with that exact name, but points to a different commit hash. To protect your version history, Git rejects the push by default so you don't accidentally overwrite a release that your team is already using.

You will see this specific rejection message in your terminal:

error: failed to push some refs to '...' 
Updates were rejected because the tag already exists in the remote.

Most Likely Causes- The Hotfix Re-tag: You found a bug in v1.0.2, deleted the tag locally to fix it, but the old v1.0.2 still exists on the server.- Team Collisions: A colleague already pushed a tag with the name you chose.- Pipeline Failures: A CI/CD runner failed halfway through a deployment and left a 'ghost' tag on the remote repository.## How to Resolve the ConflictPick the solution that best fits your situation. Usually, you either want to overwrite the server's version or update your local machine to match the server.

Method 1: Force-Updating the Remote TagUse this method if your local code is correct and you want to overwrite whatever is on the server. This is common when you need to quickly re-point a release tag to a new commit (e.g., moving v1.0.5 from commit a1b2c3d to e5f6g7h).

Run the following command:

git push origin <tag_name> --force

Example for a specific version:

git push origin v1.0.2 --force

Pro tip: Use this sparingly. If five other developers already pulled the old v1.0.2, their local environments will become out of sync with the server, leading to more confusion.

Method 2: The 'Clean Slate' Approach (Delete and Re-push)Manually deleting the tag from both locations is often the safest way to ensure no cached data interferes with your deployment. It makes the process explicit and easy to track.

  • Remove the tag from your local machine:git tag -d v1.0.2- Delete the tag from the remote server:git push origin --delete v1.0.2- Create the fresh tag locally:git tag v1.0.2- Push it back to the remote:``` git push origin v1.0.2
- **Fetch and overwrite local tags:**```
git fetch --tags -f
```- **Check your tag list:**```
git tag -l
```The `-f` flag here is the key. It tells Git to forcefully replace your local tag definitions with the ones stored on `origin`.
## Verifying the FixOnce you've pushed or synced, verify that the remote tag points to the right place. You can peek at the remote tags without downloading them using `ls-remote`:

git ls-remote --tags origin


Check the commit hash (the 40-character string) next to your tag. Then, compare it to your local tag hash by running:

git show v1.0.2 --summary


If the hashes (e.g., `7b9a1c...`) match on both sides, your tags are perfectly synchronized.
## Best Practices for TaggingTags are meant to be immutable. To avoid these errors in the future, try these workflow shifts:
- **Never Reuse Versions:** If `v1.0.0` has a bug, don't move the tag. Release `v1.0.1`. It’s cleaner for your users and your build tools.- **Use `--follow-tags`:** Instead of using `git push --tags` (which pushes every tag you've ever created), use `git push --follow-tags`. This only pushes tags associated with the commits you are currently uploading.- **Automate with CI/CD:** Let your deployment pipeline handle tagging. When a human manually tags `v1.2.0` on a Friday afternoon, mistakes are much more likely to happen.

Related Error Notes