0

I follow the following steps to push my codes.

git checkout developement
git fetch origin
git merge origin/development
git checkout <feature-branch-name>
git rebase development
git push origin <feature-branch-name>

It gets the following error. I am the only user for the feature branch, so my codes are updated. This error only happens after my first push. I do not understand why it shows this error.

error: failed to push some refs to 'https://*****@bitbucket.org/jiahaokou/spring5webapp.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.
PLee
  • 393
  • 9
  • 26

1 Answers1

1

Since you rebased the feature branch, the -f flag is required on the push. You can read more here.

McKay M
  • 448
  • 2
  • 8