version control - recover GIT repository after HDD crash -


linux magrathea 3.6.11+ #474 preempt thu jun 13 17:14:42 bst 2013 armv6l gnu/linux on raspberry. works git server.repositories have no branches. i´m beginner git love it!

i able recover data using fsck , found git objects in lost-found. after reading threads here did following:

  • create new empty git repository: git init
  • copy objects new repository .git/objects
  • run git fsck --full

no bad errors.

but if try git log get

fatal: bad default revision 'head'

what next step? how reconnect last state?

if try clone repository using: git clone git@magrathea:/gitroot/chorus. repository empty.

i'm sorry i'm simple user of git. not known internal organization of git.

please kind , provide me tips.

you message when head refers doesn't exist. when git init, head attached master branch -- haven't committed revisions yet. thus: "bad default revision" here means "no" default revision.

so @ .git/logs/refs/heads/master in repo recovered objects from, want second word (awk {print $2;exit} file). in repo you're constructing,

git update-ref -m "reconstructing repo" refs/heads/masterthat_sha.

now, recall, git fsck chases refs, , don't have yet, staying silent didn't mean much. luck.

(edit: git branch masterthat_sha work well...)


Comments

Popular posts from this blog

PHPMotion implementation - URL based videos (Hosted on separate location) -

javascript - Using Windows Media Player as video fallback for video tag -

c# - Unity IoC Lifetime per HttpRequest for UserStore -