Skip to content

Latest commit

 

History

History
10 lines (7 loc) · 374 Bytes

File metadata and controls

10 lines (7 loc) · 374 Bytes

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