Using the latest git (2.1.0.24
), whenever I try to git rebase -i
to squash
some commits, the squash cannot detach HEAD
state. I expect it to squash the commits and put me back on my branch as I expected. There are no unstaged files, changes in my working tree, or anything in the stash. Why is it doing this?
> [master] » git rebase -i HEAD~3
(I squash a few commits)...
pick c9e9b62 Fixes super important bug #123.
squash c0dc9f9 wip
pick 5385a37 wip2
# Rebase fb83e59..5385a37 onto fb83e59
(Then it gives me)
Note: checking out 'c9e9b62'.
You are in 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by performing another checkout.
If you want to create a new branch to retain commits you create, you may
do so (now or later) by using -b with the checkout command again. Example:
git checkout -b new_branch_name
HEAD is now at c9e9b62... Fixes super-important bug #123.
could not detach HEAD
It appears to rebase successfully, but for some reason won't put me back on the branch.
> [c9e9b62] » git rebase --continue
No rebase in progress?
git graph log BEFORE the rebase attempt:
* 5385a37 (HEAD, master) wip2
* c0dc9f9 wip
* c9e9b62 Fixes super-important bug #123.
* ff80ed9 random commit msg
* 1f407d5 random commit msg
...
* ef106db random commit msg
* 6c244ef Merge branch 'sentences'
|\
| * a641cbf (origin/sentences) random commit msg
| * bfe8eae random commit msg
| ...
git graph log AFTER the rebase attempt:
* c9e9b62 (HEAD) Fixes super-important bug #123.
* ff80ed9 random commit msg
* 1f407d5 random commit msg
...
* ef106db random commit msg
* 6c244ef Merge branch 'sentences'
|\
| * a641cbf (origin/sentences) random commit msg
| * bfe8eae random commit msg
| ...
git rebase --continue
? Or--abort
? – Tantalicgit log --graph --oneline --decorate
– Tartuffegit rebase -i
attempt? If so, can you provide the graph before starting the rebase process? – Tartuffemaster
still present on the graph after your attempt? I don't see it anymore in your graph sample – Tartuffe