Re: Broken index file - any hope?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jonas Schneider <JonasSchneider@xxxxxx> wrote:
> I come from the Ruby on Rails world, where Git is now spreading like ...  
> duh, something fast.
> Today I sadly lost my complete .git directory, only the working copy was  
> left behind.
> I reconstructed the directory, but the index file seems to be corrupt,  
> every command just tells me about a bad signature.
> I hope the rest of the repository is intanct. If it is, is there any  
> chance to restore/rebuild that index file from the rest?
> I don't have an idea of the internals of git, but I know the objects are  
> stored in different files, and maybe on top of that
> I could rebuild the index file.

Give this a shot:

  git read-tree --reset HEAD
  git status

at worst you lose staged changes.  At best you recover the index
file.

-- 
Shawn.
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux