Thread (14 messages) 14 messages, 7 authors, 2016-06-15

Re: Recovering from epic fail (deleted .git/objects/pack)

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:45:45

Possibly related (same subject, not in this thread)

"R. Tyler Ballance" [off-list ref] writes:
I really wish I didn't have to ask this question, as we discussed in
#git early this morning, whiskey is the likely answer.

For unexplainable reasons one of our sysadmins got trigger-happy when he
tried to prune a temp_pack file generated and left in a
developer's .git/ directory after a git operation aborted (disk quota
exceeded)

As a result, the sysadmin killed the developers
entire .git/objects/pack/ directory. (insert copious amounts of whiskey
here)

He did not however delete all the other contents of .git/objects (00/,
01/, etc)

Is there a feasible way that I can properly recover
the .git/objects/pack directory such that the developer who had their
last two weeks of local work thrashed can get it back?
I do not know about "feasible" and "properly", but ...

 (0) take backup of the repository of this unfortunate developer.

 (1) make a fresh clone of the central repository that this unfortunate
     developer's work started out from.

 (2) copy the contents of the .git/objects/pack/ of that clone to the
     developer's .git/objects/pack/.

See if "fsck --full" complains after that.  If the repository was not
repacked during that period, all objects created by the activity by the
unfortunate developer would be loose, so ...
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help