General
Git Remove All Commits
How remove all commits from Git. Switch to new_branch: git checkout --orphan new_branch Add all the files: git add -A Commit the changes as “initial commit“ git commit -am "initial commit" Delete “old” main branch git branch -D main Rename the current “new_branch” to main