简体   繁体   中英

Verifying a git repository (Stash) restore

We have disaster recovery plans that mean we take a backup of our git installation (Atlassian Stash in our case) and restore it on a test server to verify the backup was a good one. If the restore process fails then we have a problem but we're wondering about going a bit further when the restore is a success and verifying the restored repositories.

Would using git fsck be a good idea here? Running it locally as a developer throws some dangling or unreachable objects, I believe this is a normal thing that happens. But on a fresh git clone there shouldn't be any issues right? So if fsck had errors then we're having a bad time?

As a second option we could also point our CI server at a restored repository and have it build and run tests. As our main branch should always be healthy then any build failures would indicate an issue.

Any other ideas on verifying a repository is good and healthy?

Gog

  1. You can use the commands in this SO question to verify you local and remote are same. Just iterate through each branch and check that they are the same

  2. In case your backup is just backing up the bare repository , you can do a unix diff command to verify that your backup is good

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM