I have a scenario where I have a git branch (b) based off of develop.
I then made changes to branch (b) and pushed it to remote (b).
Some other developer made a PR and had their code merged into develop.
I then pull the changes from remote/develop and rebased my local branch (b) onto develop.
I then make more changes to my local branch (b)
When I commit and push my changes, I get a rejected error:
[! [rejected] feature/b-> feature/b (non-fast-forward)
error: failed to push some refs to 'gitlab'
hint: Updates were rejected because the tip of your current branch is behind]
What I normally tend to do is to do a --force
push.
But I'm wondering if this is the right approach.