我对 git
相当陌生,但目前正在团队环境中使用它来管理我们的代码。我有一些重新调整基础的问题,我修复他们使用:
git checkout --ours filename.txt
git add filename.txt
git rebase --continue
现在我希望推送我的更改,因此运行以下命令:
$ git push origin feature/my_feature_branch
给了我以下错误:
To ssh://git@coderepo.com:7999/repo/myproject.git
! [rejected] feature/my_feature_branch -> feature/my_feature_branch (non-fast-forward)
error: failed to push some refs to 'ssh://git@coderepo.com:7999/repo/myproject.git'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Merge the remote changes (e.g. 'git pull')
hint: before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
我要怎么做才能消除这个错误呢?
注意: 我尽量避免使用 --force
选项。