Clicking tags with git rejected as non-fast forward

Git pull works does not show any updates:

sh-3.2$ git pull Already up-to-date. 

When I press git, 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 (eg 'git pull') before pushing again. See the 'Note about fast-forwards' section of 'git push --help' for details. 

Rebasing gives the same thing:

 sh-3.2$ git pull --rebase Current branch devel is up to date. 

The DEVEL_BLEEDINGEDGE tag is used in my daily auto-build scripts, every time I need to deploy some new things with these scripts, I move this tag with:

 git tag -f DEVEL_BLEEDINGEDGE 

So why can't I get my tag back?

I get this error from time to time for other tags that I don't move too.

+4
source share
1 answer

It looks like you want to move the tag. Tags are intended to indicate the specific state of your project, for example, version 1.0. This should not change daily. If you still want to change (move) the tag, you can do this using the double -f (force) switch:

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

In your case, I would use branches to mark the "edge of the expiration of the developer"

 git branch -f DEVEL_BLEEDINGEDGE HEAD git push --tags 

There is no "-f" switch to press if you move the DEVEL_BLEEDINGEDGE branch forward within the same history path.

+9
source

Source: https://habr.com/ru/post/1469484/


All Articles