- Published on
Delete all commit history
97 words1 min read
- Checkout a new branch -
git checkout --orphan latest_branch - Add all the files -
git add -A - Commit the changes -
git commit -am "commit message" - Delete the
mainbranch -git branch -D main - Rename the current branch to
main-git branch -m main - Force push to update the remote repository -
git push -f origin main