Git rebase: no tracking information

匿名 (未验证) 提交于 2019-12-03 02:29:01

问题:

I am using git version 2.9.0.windows.1 and I want to rebase a local repository (no remote). But I always get

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

If you wish to set tracking information for this branch you can do so with:

git branch --set-upstream-to=/ master

I tried git rebase -i HEAD~3 as suggested in this solution, but it doesn't work in my case.

If I simply copy the repository to my Linux machine, git rebase works fine. I checked with git config --list on both machines, they seem almost the same.

So I am wondering what makes git rebase doesn't work on my Windows machine.

UPDATE I did a test for a small case, see my history: git history and rebase: git rebase message

No matter what option I use with git rebase, I got the same message

回答1:

git rebase -i HEAD~3 should work unless:

  • you are in a branch which has not 3 commits (but only 2 or one since the first commit),
  • you are not in a branch (detached HEAD: check with git branch -vv)
  • you are affected by issue 704 and issue 710

I added bash.exe to MacType utility exclusion list, now all is good.



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!