osx - Use git rebase and I get 'Nothing to do' -
same title type "git rebase -i [commit_id]", , got this:
error detected while processing /users/my_name/.vimrc: line 1: e117: unknown function: pathogen#infect e15: invalid expression: pathogen#infect() press enter or type command continue
after type enter, success enter vim editor.
1 pick f694d12 test 2 3 # rebase 3dad5af..f694d12 onto 3dad5af (1 command(s)) 4 # 5 # commands: 6 # p, pick = use commit 7 # r, reword = use commit, edit commit message 8 # e, edit = use commit, stop amending 9 # s, squash = use commit, meld previous commit 10 # f, fixup = "squash", discard commit's log message 11 # x, exec = run command (the rest of line) using shell 12 # d, drop = remove commit 13 # 14 # these lines can re-ordered; executed top bottom. 15 # 16 # if remove line here commit lost. 17 # 18 # however, if remove everything, rebase aborted. 19 # 20 # note empty commits commented out
i delete line 1 "pick f694d12 test" , save it, got report
nothing
how can fix it?
if save empty file during merge / rebase, git thinks changed mind , don't want anything. see second-to-last line in rebase todo file provided:
# however, if remove everything, rebase aborted.
to work around this, can leave commit line, use drop
command. todo file this:
drop f694d12 test # rebase 3dad5af..f694d12 onto 3dad5af (1 command(s)) # # commands: # p, pick = use commit # r, reword = use commit, edit commit message # e, edit = use commit, stop amending # s, squash = use commit, meld previous commit # f, fixup = "squash", discard commit's log message # x, exec = run command (the rest of line) using shell # d, drop = remove commit # # these lines can re-ordered; executed top bottom. # # if remove line here commit lost. # # however, if remove everything, rebase aborted. # # note empty commits commented out
alternatively, if want delete last commit, can this:
git reset --hard head^
or:
git reset --hard 3dad5af
Comments
Post a Comment