67

I will try to explain the problem that I have. I have used the rebase option via git bash many times. Now I have SmartGit and don’t know why rebase is not correct.

Step 1:

Step 2:

Step 3:

The result is that HEAD detaches.

ChrisGPT was on strike
  • 127,765
  • 105
  • 273
  • 257
Ark
  • 1,343
  • 2
  • 12
  • 26
  • 6
    Assuming you're not actually trying to use `git am` somewhere else, does `git am --abort` make any difference? – ChrisGPT was on strike Jan 15 '14 at 14:49
  • And: is a "git rebase" still possible from command line while not possible from SmartGit? – mstrap Jan 15 '14 at 15:01
  • @mstrap Yes, possible from command line while not possible from SmartGit – Ark Jan 15 '14 at 15:25
  • @Chris I think smartgit don't represent command line, so i dont know how to force him to use git am command. I like he by convenient UI. And dont wanna back to GIT bach command line – Ark Jan 15 '14 at 15:30
  • 1
    @Ark did you also try with the --preserve-merges options from command line? It would be quite strange to have just SmartGit failing, as it's obviously using command line Git here. That said, I'd recommend to follow the advice of Chris, using command line Gitt to `git am --abort`. Then the rebase should succeed. – mstrap Jan 15 '14 at 18:43

4 Answers4

184

The same issue i have faced, i will delete the local branch in my machine and recreate it from origin each and every time. But finally i got the solution. I ran the below command

git am --abort solved my problem.

Lucas
  • 17,277
  • 5
  • 45
  • 40
Madhan Ayyasamy
  • 15,600
  • 3
  • 19
  • 18
  • 12
    Issue also seen in SourceTree - and your fix works there too. Thx – Holger Bille Feb 28 '17 at 14:25
  • 3
    Similar error in SourceTree, did `git am --continue` in dos, and the output message helped: "If there is nothing left to stage, chances are that something else already introduced the same changes; you might want to skip this patch [...] run "git am --skip" instead." Indeed, the same change as my patch was introduced by a merged branch (or I messed up somewhere trying to fix this). Ran `git am --skip`, all fine now. – Thierry_S Nov 30 '17 at 08:15
  • Was just applying patches through Sourcetree. `--continue` is what I needed after manual merging conflicts. – Pysis Aug 01 '18 at 18:29
  • I had this same problem with Sourcetree. Solved by opening git cli and running this abort command. Worked! – GEMI Dec 09 '20 at 06:56
8

The only thing that I could do to cancel out the rebase after getting this error message was to delete the .git\rebase-apply folder and all of its contents.

rm .\.git\rebase-apply
Yaakov Ellis
  • 40,752
  • 27
  • 129
  • 174
1

I encountered this in SourceTree, where branches had different .gitignore files. I resolved it by committing a matching .gitignore prior to the merge.

Markus
  • 2,265
  • 5
  • 28
  • 54
0

I got this error error when trying to git pull –rebase origin master.

The accepted git am --abort didn't help, unfortunately, saying:

error: You seem to have moved HEAD since the last 'am' failure.

Not rewinding to ORIG_HEAD

But the good old pull did work (and the rebase started working after it, too):

git pull origin master
ᴍᴇʜᴏᴠ
  • 4,804
  • 4
  • 44
  • 57