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 [email protected]:some/git/repo
! [rejected] DEVEL_BLEEDINGEDGE -> DEVEL_BLEEDINGEDGE (non-fast-forward)
error: failed to push some refs to '[email protected]: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.
If you do a commit in one project and then accidentally push this commit, with bypassing code review, to another project, this will fail with the error message 'non-fast forward'. To fix the problem you should check the push specification and verify that you are pushing the commit to the correct project.
A non-fast-forward merge is a merge where the main branch had intervening changes between the branch point and the merge back to the main branch. In this case, a user can simulate a fast-forward by rebasing rather than merging.
A commit gets rejected and causes a failed to push some refs to error because the remote branch contains code that you do not have locally. What this means is that your local git repository is not compatible with the remote origin.
Enter --force. This option overrides the “fast forward” restriction and matches our local branch to the remote branch.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With