Humanity

Edit the world by your favorite way

Could not move back to refs/heads/test

git-rebase中に戻るべきブランチを削除したりするとこんなメッセージが出ます。
そんな恐ろしいことをする人はここを読んでる人の中にはいませんね。
うっかりこのメッセージに出くわして検索でこのページに来た方は慌てずに「git rebase --skip」しましょう。
エラーと言われますがとりあえずrebase状態からは復帰してるはずです。
以下慌てふためいたログをそのまま張り付けてみます。



.-(~/work/git/simpletap.vim)-----------------------------------------------------------------------------------------------------------(takuya@ubuntu)-
`--> git rebase master (git)-[feat/oo-interface|rebase]

It seems that I cannot create a rebase-apply directory, and
I wonder if you are in the middle of patch application or another
rebase. If that is not the case, please
rm -fr /home/takuya/work/git/simpletap.vim/.git/rebase-apply
and run me again. I am stopping in case you still have something
valuable there.
.-(~/work/git/simpletap.vim)-----------------------------------------------------------------------------------------------------------(takuya@ubuntu)-
`--> git log -p >>oo-interface.log (git)-[feat/oo-interface|rebase]
zsh: no such file or directory: oo-interface.log
.-(~/work/git/simpletap.vim)-----------------------------------------------------------------------------------------------------------(takuya@ubuntu)-
`--> git log -p >oo-interface.log (git)-[feat/oo-interface|rebase]
.-(~/work/git/simpletap.vim)-----------------------------------------------------------------------------------------------------------(takuya@ubuntu)-
`--> git co master (git)-[feat/oo-interface|rebase]
Switched to branch 'master'
.-(~/work/git/simpletap.vim)-----------------------------------------------------------------------------------------------------------(takuya@ubuntu)-
`--> git log -p >master.log (git)-[master|rebase]
.-(~/work/git/simpletap.vim)-----------------------------------------------------------------------------------------------------------(takuya@ubuntu)-
`--> git cont (git)-[master|rebase]
Applying: Declare global variables at s:initialize_once().
No changes - did you forget to use 'git add'?

When you have resolved this problem run "git rebase --continue".
If you would prefer to skip this patch, instead run "git rebase --skip".
To restore the original branch and stop rebasing run "git rebase --abort".

.-(~/work/git/simpletap.vim)-----------------------------------------------------------------------------------------------------------(takuya@ubuntu)-
`--> git st (git)-[master|rebase]
# On branch master
# Untracked files:
# (use "git add ..." to include in what will be committed)
#
# master.log
# oo-interface.log
# oo.diff
# test/
nothing added to commit but untracked files present (use "git add" to track)
.-(~/work/git/simpletap.vim)-----------------------------------------------------------------------------------------------------------(takuya@ubuntu)-
`--> git rebase --abort (git)-[master|rebase]
error: unable to resolve reference refs/heads/test: No such file or directory
fatal: Cannot lock the ref 'refs/heads/test'.
Could not move back to refs/heads/test
.-(~/work/git/simpletap.vim)-----------------------------------------------------------------------------------------------------------(takuya@ubuntu)-
`--> git co -b test (git)-[master|rebase]
Switched to a new branch 'test'
.-(~/work/git/simpletap.vim)-----------------------------------------------------------------------------------------------------------(takuya@ubuntu)-
`--> git rebase --abort (git)-[test|rebase]
error: Ref refs/heads/test is at 31bd5d93856c6d1ff680ee12c4d7efc77a89bf51 but expected f6ba7107f5670b44994c96969f1c530f569092d0
fatal: Cannot lock the ref 'refs/heads/test'.
Could not move back to refs/heads/test
.-(~/work/git/simpletap.vim)-----------------------------------------------------------------------------------------------------------(takuya@ubuntu)-
`--> git st (git)-[test|rebase]
# On branch test
# Untracked files:
# (use "git add ..." to include in what will be committed)
#
# master.log
# oo-interface.log
# oo.diff
# test/
nothing added to commit but untracked files present (use "git add" to track)
.-(~/work/git/simpletap.vim)-----------------------------------------------------------------------------------------------------------(takuya@ubuntu)-
`--> git rebase --skip (git)-[test|rebase]
HEAD is now at 31bd5d9 Clean up code.
Nothing to do.
error: Ref refs/heads/test is at 31bd5d93856c6d1ff680ee12c4d7efc77a89bf51 but expected f6ba7107f5670b44994c96969f1c530f569092d0
fatal: Cannot lock the ref 'refs/heads/test'.
Could not move back to refs/heads/test
.-(~/work/git/simpletap.vim)-----------------------------------------------------------------------------------------------------------(takuya@ubuntu)-
`--> git co master (git)-[test]
Switched to branch 'master'
.-(~/work/git/simpletap.vim)-----------------------------------------------------------------------------------------------------------(takuya@ubuntu)-
`--> git b -d test (git)-[master]
Deleted branch test (was 31bd5d9).
.-(~/work/git/simpletap.vim)-----------------------------------------------------------------------------------------------------------(takuya@ubuntu)-
`--> git log (git)-[master]
commit 31bd5d93856c6d1ff680ee12c4d7efc77a89bf51
Author: tyru
Date: Sat Mar 6 17:17:50 2010 +0900

Clean up code.