Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git rebase -i does nothing

Tags:

git

rebase

squash

I'm having some trouble with git rebase -i not working as I expect from reading various pieces of online documentation and tutorials.

I'm trying to squash my last four commits into one. Imagine a branch dev with remote origin/dev and commits

A -> B -> C -> D -> E
│                   └ dev
└ origin/dev

And I want to end up here:

     ┌ dev
A -> F
│
└ origin/dev

Where F contains all the changes from B, C, D and E. So, given that I have dev checked out, I should be able to run git rebase -i origin/dev or git rebase -i HEAD~4 then squash C, D and E, right?

Here's my problem: running either of those rebase commands doesn't popup a git window to do anything. The console just returns:

Successfully rebased and updated refs/heads/dev.

I'm confused, why is the interactive rebase not working? Is there some problem with my Git configuration?

Update

git config --global rebase.autoSquash returns nothing

like image 708
Richiban Avatar asked Dec 15 '22 13:12

Richiban


1 Answers

Ok, I found the answer: it was my git config after all.

After installing Github's Atom yesterday I'd followed instructions at http://blog.atom.io/2014/03/13/git-integration.html, namely:

git config --global core.editor "atom --wait"

What was happening is that everytime I tried to rebase Atom opened then immediately crashed. Git interpreted this as me finishing the rebase and just picked all commits, which had no net effect.

Annoying problem to find, but got there in the end.

like image 140
Richiban Avatar answered Dec 23 '22 08:12

Richiban