昨日、今日と二日続けてrepoが壊れたので解決策を探ってみました。コミットはこまめにしておくのが吉だと思います。

   1  $ git status
   2  error: bad signature
   3  fatal: index file corrupt

git-fsck --fullというコマンドも試してみたのですが、やっぱりだめ。というわけで、ダメもとで下記をやってみたらすんなり復旧できた。yay!

After trying many things, I deleted .git/index and ran git-reset which regenerated the file.
http://www.nishioka.com/blog/2008/01/source-control-with-git-and-cygwin.html

つまり下記でok!

   1  $ rm .git/index 
   2  $ git reset

Refs

http://www8.atwiki.jp/git_jp/pub/Documentation.ja/user-manual.html#recovering-from-repository-corruption

おまけ

誰かがバグを修正してコミットしてくれて、自分の手元のrepoが古くなったとき、rebaseすれば最新のをfetchしてきてくれます。

   1  $ git svn rebase

posted by Png satoko on Thu 26 Jun 2008 at 11:20
Contents
gitのRepoが壊れた
Comments
瀧内元気: MacOS版は以下にあります * [genki/ViMouse](https://githu... '23-1
KingofSmack: Here also good reads for this mobile applicatio... '14-5
Spencer: You don't have to re-compile it, this version w... '14-4
staiano: Any chance we can get a recompile for 10.9? '14-1
dsjf: https://gist.github.com/6bf1bf2c3cbb5eb6e7a7 これ... '13-1
Services from s21g
twpro(ツイプロ)
Twitterプロフィールを快適検索
地価2009
土地の値段を調べてみよう
MyRestaurant
自分だけのレストラン手帳
Formula
ブログに数式を埋め込める数式コミュニティ