我使用git作为本地源码控制系统,主要用于历史和差异跟踪。我仍然想使用rebase对我会定期提交的WIP提交进行修复/压缩。但是,当我尝试执行git rebase -i时,我得到了以下结果:
There is no tracking information for the current branch.
Please specify which branch you want to rebase against.
See git-rebase(1) for details
git rebase <branch>
If you wish to set tracking information for this branch you can do so with:
git branch --set-upstream-to=<remote>/<branch> MyBranch似乎git不希望你在没有上游遥控器的情况下使用交互式rebase?我该怎么做?
发布于 2015-06-04 00:22:00
简而言之,没有指定目标分支的git rebase -i会让git假定您正在尝试根据您的分支跟踪的远程分支重新建立基础。这就是为什么错误消息会提到关于远程的东西。
当您指定目标时,git将根据该commit-ish重新建立基址
git rebase -i <commit-ish>发布于 2016-11-24 19:02:23
所以简而言之--如果你有3个本地提交,你现在想要交互的rebase/squash/等它们:
git rebase -i HEAD~3(参见Sébastien的解释!)
https://stackoverflow.com/questions/30625213
复制相似问题