clean repo history optional: back up the remote, just in case git clone --mirror "$(git config --get remote.origin.url)" ../repo-backup.mirror create a new single commit whose tree == current HEAD's tree git reset "$(git commit-tree HEAD^{tree} -m 'Clean slate')" push it, overwriting the remote branch (disable branch protection first) git push -f origin HEAD:main