背景

现在有分支a和分支b。b是从a的某个历史commit中checkout出来的。在b上进行了开发后,要merge到a。这时最好先rebase到a,然后提交pull request。

问题表现

对本地分支a进行了git pull后,在checkout到分支b,然后执行git rebase a。出现标题的warning,然后显示Current branch b is up to date.

检查git log发现分支a的后续commit并未被merge到分支b来。若使用git merge a,结果一样。

解决方案

$ git show-ref a
<commit hash> refs/heads/feature/a
<commit hash> refs/remotes/origin/feature/a
<commit hash> refs/tags/feature/a

ambiguous是由于本地同时存在名为a的分支和标签。现在移除标签

git tag -d a

重新rebase即可

git rebase a
Logo

开源鸿蒙跨平台开发社区汇聚开发者与厂商,共建“一次开发,多端部署”的开源生态,致力于降低跨端开发门槛,推动万物智联创新。

更多推荐