Replies: 1 comment 1 reply
-
Do this instead:
Nothing about the commit, that are rewritten, changes. You forgo applying the very last commit, but when Git checks whether "anything changed", it does not look at that commit, just the ones you told it to apply and since you are instructing Git to replay them exactly as before, it can actually just fast-forward to the latest of these commits, i.e., there is "nothing to do". But this behavior is indeed a bit counterintuitive. For example you might want to sign the last n commits, without rearranging them or anything like that. In such cases you need to use |
Beta Was this translation helpful? Give feedback.
-
Situation
I want to use an interactive rebase to remove the single most recent (or the x most recent) commit(s) from history. To this end I
magit-status
usingC-x g
in some project fileRecent commits
sectionr
i
to start the interactive rebasingk
to mark the commit to be droppedC-c C-c
to tell Git to make it happenExpected behavior
The commit is removed from history, and I am thrown back to the
magit-status
windowActual behavior
I an thrown back to the
magit-status
with aGitError
showingnothing to do [Type ``$' for details]
. Themagit-process
, brough up with$
, showsThe commit is not removed from the history (apparently, the history does not change at all).
Backtrace
I entered
toggle-debug-on-error
and executed the same sequence of commands which did not produce an error message. This seems to be an error in a sub command launched by git (?). I suspect that this issue is some corner case in the interactive rebase implementation.Output of
magit-version
Plain Emacs
This defect is reproducible on my system using
emacs -Q
Beta Was this translation helpful? Give feedback.
All reactions