egg
egg

Reputation: 373

Git broken after restoring to new server - how to resolve?

my magento dev workflow has been:

Yesterday the live server died (RAID errors or something). The hosting company gave me a new server with new IP etc.

To get the site up and running quickly, I just FTP'd the whole repo from my PC to the live server, uploading the last version of the database. All good, site back online within 2 hours.

However, the git link is now broken. Going into the new server, git status reported:

error: bad index file sha1 signature. fatal: index file corrupt

So I deleted the index on the server (following some tips found here). But that gives another error:

error: inflate: data stream error (incorrect data check)
fatal: object 72264d99759a1d21b2f532ab0eb04a57fde7021d is corrupted".

So, now I don't really know where to start and how to get my git flow running again. Any tips?

Upvotes: 2

Views: 59

Answers (1)

AD7six
AD7six

Reputation: 66339

error: bad index file sha1 signature. fatal: index file corrupt

Read that as "the .git folder contents are corrupt/not useful"

Clone again

The simplest solution is to clone again. You don't need to nuke your restored working copy just the git folder. i.e.:

$ cd /tmp
$ git clone url-to-your-repo.git new
$ cd /the/install
$ mv .git /tmp/old-git # in case you want to take a look at something
$ mv /tmp/new/.git .

Upvotes: 1

Related Questions