I am working in a presentation to Hotmart Dev team and it will basically have a hands on during this presentation and I will be sharing the final code on Github.
But I don't want them to follow each step I made so I decided to clear the whole commit history.
I obviously had to search because I never had a need to clear the whole commit history and I found this on Stack Overflow from 2014 and edited in 2020:
The answer is pretty clear how I had to do it, so I am sharing here.
Let's see how it was done!
git checkout --orphan latest_branch
Add all the files
git add -A
Commit the changes
git commit -am "commit message"
Delete the branch
git branch -D main
Rename the current branch to main
git branch -m main
Finally, force update your repository
git push -f origin main
That's all folks!