I'm trying to remove two last commits via rebase/cherry-pick. After invoking git rebase HEAD^^^ -i
I'm leaving only necessary commit (leaving everything up to HEAD^^
, so I'm dropping HEAD^
and HEAD
).
After the git push
I see the following:
! [rejected] dev -> dev (non-fast-forward)
error: failed to push some refs to 'git@bitbucket.org:XXXXXX/YYYYYYYYY.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
But git pull
just fast-forwards ho former HEAD commit. So, I'm ending up with what I've started with. What am I doing wrong?