awesome-git-history-reset

Solid

Erases a repository's entire history into one fresh commit and force-pushes, after access checks, a mirror backup, a secret scan and a confirmation gate. Use when asked to wipe history.

Code & Development 10 stars 2 forks Updated yesterday MIT

Install

View on GitHub

Quality Score: 82/100

Stars 20%
35
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

# Git History Reset Collapse a repository's entire history into one fresh `Initial commit` and force-push it, so the published commit log starts clean. The file tree is preserved byte-for-byte; only the history leading to it is discarded. Why the ceremony: this is an irreversible, outward-facing rewrite of a shared remote. Once you force-push, every old commit on the default branch is gone from the tip, open pull requests break, and anyone who cloned or forked keeps the old history anyway. The steps below are not bureaucracy — each one closes a specific way this goes wrong: pushing without write access, discovering too late that the branch was protected, losing content in the squash, or force-pushing over a teammate's commit you never saw. ## Core principle NOTHING IRREVERSIBLE UNTIL FOUR THINGS HOLD: write access is confirmed, a mirror backup exists and is verified, the history is scanned for secrets, and the user has explicitly confirmed the wipe. If any one is missing, stop at that gate. Four invariants hold throughout: - Never operate on the user's existing checkout. Always work in a *fresh clone* in a scratch directory. If the push fails or the result is wrong, the scratch clone is disposable and the user's own working copy was never touched. - Never assume the default branch is `main`. Detect it from the remote. Rewriting the wrong branch, or one that isn't the default, silently leaves the real history in place. - Never delete the backup, and never delete a remote...

Details

Author
khasky
Repository
khasky/awesome-agent-skills
Created
6 months ago
Last Updated
yesterday
Language
Python
License
MIT

Integrates with

Similar Skills

Semantically similar based on skill content — not just same category