Re: how to recover a repository

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

 



On Thu, 16 Dec 2010, Jonathan Nieder wrote:

Hi David,

david@xxxxxxx wrote:

I managed to do a 'rm *' in the .git directory (the usual sort of
fat-fingering when cleaning up after another mistake)

the subdirectories are still there.

I'd suggest:

1. Make a backup!
2. From the worktree (i.e. parent to the .git directory),
   run "git init".
3. git update-ref HEAD refs/heads/(branch you were on)

I was on the default branch but if I do 'git update-ref HEAD refs/heads/master' I get an error 'not a valid SHA1'

.git/refs/heads is empty

.git/logs/HEAD looks like it shows all the commits in it properly

David Lang

4. git reset;	# (alas, the old index file is gone)
5. git diff; gitk --all

See gitrepository-layout(7) for details.

--
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]