繁体   English   中英

如何解决git错误:重命名远程分支时“更新被拒绝,因为当前分支的提示落后”

[英]How to resolve git error: “Updates were rejected because the tip of your current branch is behind” when renaming a remote branch

我已经读过这个问题,但我的问题是不同的。

我正在尝试将名为feature/fix_unofficial_locales的远程分支重命名为features/fix-unofficial-locales

git checkout feature/fix_unofficial_locales
git pull
git branch -m features/fix-unofficial-locales
git push origin --delete feature/fix_unofficial_locales
git push origin -u features/fix-unofficial-locales

现在出现错误消息。 在此处输入图片说明

feature/fix_unofficial_locales以前从未在我的本地机器中出现过,所以我是第一次检查它。 我没有进行任何提交,所以我不明白为什么我当前分支的提示在后面......

错误消息 feature/fix-unofficial-locales -> feature/fix-unofficial-locales (non-fast-forward) 仅当您使用现有提交的远程分支的名称重命名分支时才有意义。

尝试:

git fetch
git branch -u origin/features/fix-unofficial-locales features/fix-unofficial-locales
git pull
# resolve conflicts
git push

您可以查看此答案: 如何在 Bitbucket 上重命名分支后推送更改?

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM