Pushing tags with git rejected as non-fast-forwarding

git

Solution

It looks like you want to move the tag. Tags are designed to mark a specific state of your project, like release 1.0. This shouldn't be changed on daily basis. If you want to change (move) a tag anyway, you can do it using the -f (force) switch twice:

git tag -f TAG_I_MOVE
git push --tags -f

In your case I would use branches to mark the "developer bleeding edge"

git branch -f DEVEL_BLEEDINGEDGE HEAD
git push --tags

Here no "-f" switch for push needed, as long as you move your DEVEL_BLEEDINGEDGE branch forward within the same history path.

Problem

Git pull works doesn't show any updates: ``` sh-3.2$ git pull Already up-to-date. ``` When I do a git push I get an error: ``` sh-3.2$ git push --tags To user@example.com:some/git/repo ! [rejected] DEVEL_BLEEDINGEDGE -> DEVEL_BLEEDINGEDGE (non-fast-forward) error: failed to push some refs to 'user@example.com:some/git/repo' To prevent you from losing history, non-fast-forward updates were rejected Merge the remote changes (e.g. 'git pull') before pushing again. See the 'Note about fast-forwards' section of 'git push --help' for details. ``` Rebasing gives the same: ``` sh-3.2$ git pull --rebase Current branch devel is up to date. ``` The DEVEL_BLEEDINGEDGE tag is used on my daily automated build scripts, everytime I need to deploy some new stuff with those scripts I move that tag with: ``` git tag -f DEVEL_BLEEDINGEDGE ``` So, why can't I push my tag back? I get this error every now and then for other tags which I don't move also.

Original source