3

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

5
  • "it doesn't work": what error message do you see? Commented Jun 17, 2016 at 7:14
  • @VonC message There is no tracking information for the current branch. Please specify which branch you want to rebase against. See git-rebase(1) for details..., like I posted. There is no editor popup which allows me to change the commit history. Commented Jun 17, 2016 at 7:24
  • It sure looks like you've hit a bug in this particular leading-edge (bleeding-edge) version of Git. Commented Jun 17, 2016 at 7:52
  • @torek Actually no: that but was seen as soon as git-for-windows 2.7.0 (January 2016) Commented Jun 17, 2016 at 9:39
  • I see: not a bug in Git per se, and not all that new, some sort of weird interaction causing problems with a (the?) Windows port of bash. Commented Jun 17, 2016 at 20:16

1 Answer 1

4

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.

Sign up to request clarification or add additional context in comments.

8 Comments

Thanks for you answer, but I don't think that is the reason. I updated the question with pictures of git history and rebase message: the branch has 3 commits and HEAD is at the tip of the branch
@NAX Do you have the same error with git rebase -i @~3 @ or git rebase -i @~3 branch? (@ is a shortcut for HEAD)
@NAX Do you have the same error in a regular CMD session (not git-bash)?
@NAX in a CMD as well?
@NAX I have seen bugs affecting git bash, and edited the answer to reference them.
|

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.