git-repair is a command-line utility for recovering damaged Git repositories. It is designed to restore a working repository where objects have become corrupted or disappeared, without necessarily requiring users to discard their local copy and clone the project again.
Git provides the git fsck command for identifying inconsistencies and missing objects, but it does not automatically repair every problem. git-repair complements this functionality by attempting to recover missing information from configured remotes and reconstruct usable repository state.
The tool prioritises returning a repository to a functional condition rather than guaranteeing recovery of every object. More aggressive repairs can discard unrecoverable history, so it is sensible to preserve a copy of a damaged repository before attempting recovery.
This is free and open source software.
Key Features
- Detect and repair several forms of Git object corruption.
- Remove corrupt objects and attempt to recover missing objects from configured remote repositories.
- Complement git fsck with automated recovery operations.
- Attempt repairs without discarding an entire local repository.
- Preserve local commits and changes where recovery is possible.
- Optional forced recovery when ordinary repair cannot restore consistency.
- Reset branches to earlier recoverable commits where necessary.
- Remove branch references that cannot be reconstructed from available objects.
- Repair index entries referring to missing files during forced recovery.
- Self-testing mode that deliberately corrupts temporary repository copies to exercise recovery procedures.
- Configurable test counts and retry options.
- Preserves tags rather than automatically deleting broken references.
- Leaves reflog and stash cleanup to separate Git maintenance operations.
- Suitable for recovery attempts on repositories containing work not yet pushed to a remote.
Website: git-repair.branchable.com
Support:
Developer: Joey Hess
License: GNU Affero General Public License v3.0
git-repair is written in Haskell. Learn Haskell with our recommended free books and free tutorials.
Related Software
| Git Storage and Security Tools | |
|---|---|
| git-lfs | Git extension for versioning large files |
| Jujutsu | Powerful version control system for software projects |
| git-bug | Distributed offline-first bug tracker |
| Dash | Rich terminal UI for GitHub |
| git-secrets | Prevent adding secrets into git repositories |
| Commitizen | Create well-structured Git commit messages |
| git-repair | Repair various forms of damage to git repositories |
| git-secret | Bash tool which stores private data inside a git repo |
| git-annex | Manage files with git without checking the file contents into git |
| gitmoji-cli | Use gitmojis in Git commit messages |
| ghq | Organise local clones of remote repositories |
| git-crypt | Transparent file encryption in git |
| gita | Manage multiple git repos |
| git-chglog | CHANGELOG generator implemented in Go |
| cz-git | Commitizen adapter and command-line tool |
| gitpane | Multi-repo Git workspace dashboard |
| git-trim | Keep Git working directories clear of stale local branches |
| gfold | Keep track of multiple Git repositories |
| Garden | Command runner and multi-repo Git configuration tool |
| mani | Manage collections of Git repositories |
| GitSocial | Git-native cross-forge collaboration |
| git-fresh | Refresh Git working copies from the terminal |
| Forge Sparks | Get Git forges notifications |
| gohome | Git standup and activity reporting CLI |
| git-appraise | Distributed code review system for Git repositories |
Read our verdict in the software roundup.
LinuxLinks helps you discover the best free and open source software for Linux. Explore our extensive collection of recommended applications, including alternatives to popular proprietary software.We also publish software reviews, Linux tutorials, hardware reviews, free programming books and articles covering the wider open source community. Browse our Linux resources to discover more. Know a useful free and open source Linux application we haven't covered? Suggest a program for inclusion. Has your software been featured on LinuxLinks? Display one of our Featured on LinuxLinks badges on your website or GitHub README. |


Please read our Comment Policy before commenting.