cover-img

How to delete all commit history in GitHub?

If you ever pushed your credentials into GitHub and you had many commits after that incident then it would be a big problem removing the credentials f

Draft

1 November, 2021

img
If you ever pushed your credentials into GitHub and you had many commits after that incident then it would be a big problem removing the credentials from the history. So one of the options would be to delete the whole commit history. In this tutorial we are going to see how to do that 😉

Deleting the commit history

Create a new branch
Add all the files
Commit the changes
Delete the branch
Rename the current branch to main
Finally, force update your repository
img
9
img
8
img
8
img
8
img
8
img
7
img
7
img
7
img
7
img
7
Avneesh Agarwal
15 yo full stack web3 developer building cool shit and teaching others

More Articles

Showwcase is a professional tech network with over 0 users from over 150 countries. We assist tech professionals in showcasing their unique skills through dedicated profiles and connect them with top global companies for career opportunities.

© Copyright 2025. Showcase Creators Inc. All rights reserved.