On Mon, Jan 14, 2013 at 01:06:16PM +0100, Matthieu Moy wrote:
> George Karpenkov <geo...@metaworld.ru> writes:
>> I've managed to corrupt my very valuable repository with a recursive
>> sed which went wrong.
>> I wanted to convert all tabs to spaces with the following command:
>> find ./ -name '*.*' -exec sed -i 's/\t/    /g' {} \;
> Clearly, this is a dangerous command as it impacts .git/. However, Git
> partially protects you from this kind of error, since object files and
> pack files are read-only by default.
> My obvious first advice is: make backups of your corrupted repository.
> Yes, I said backup_s_, better safe than sorry.

Having backed up the corrupt state, another option is to just try
running the reverse command:

find .git -name '*.*' -exec sed -i 's/    /\t/g' {} \;

I had a quick grep over some pack indices here and '    ' doesn't occur
in any of mine whereas '\t' is very common so you may find that the only
'    ' sequences are the ones you introduced.

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

Reply via email to