首页 > 解决方案 > 无法将代码推送到远程仓库

问题描述

我按照以下步骤推送我的代码。

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

它得到以下错误。我是功能分支的唯一用户,因此我的代码已更新。此错误仅在我第一次推送后发生。我不明白为什么它会显示此错误。

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.

标签: gitbitbucket

解决方案


由于您重新设置了功能分支的-f基础,因此推送时需要该标志。你可以在这里阅读更多。


推荐阅读