I created this tool for my personal use to easily reset a Git repository’s history without touching the actual code. If you find it helpful, you’re welcome to use or modify it as you like — no restrictions.
A simple script (available for both Windows and Linux) that:
- Clones your Git repo into a temporary folder
- Deletes all commit history
- Keeps your current files
- Pushes a fresh commit to the same branch
- Make sure Git is installed and set up.
- Run the script:
- On Windows, use
ghc_windows.bat - On Linux/Mac, use
ghc_linux.sh
- On Windows, use
- Enter your repo URL when asked.
- Confirm the cleanup.
- That’s it — the repo will be cleaned and updated.
⚠️ Always back up important work before running the script.
- Works on both Windows and Linux
- Checks if Git is set up
- Keeps your latest code intact
- Asks for confirmation before deleting history
- Auto-cleans temporary folders after use
- Commit history is permanently deleted — no undo
- Doesn’t support submodules or complex Git configs
- Basic error handling only