Delete all commit history in GitHub

Today we’ll show you how to delete all commit history in GitHub. It’s a very small but useful article to delete all commit history of the branch and create a fresh commit using git command.

Here, we’ll show you the two different methods to remove all commit history using git commands without removing the repository.

Ways to delete all commit history in GitHub

  1. Method 1: Using an orphan branch
  2. Method 2: By deleting the .git folder

Method 1: Using an orphan branch

In case, if you are facing any issue to delete the .git folder then you can use this approach. With the help of this method, we can keep the code in its current state.

If this method does not work, try the following method.

Method 2: By deleting the .git folder

In this method, we will remove the git commit history by deleting the .git folder because all the committed history are in the .git folder. Follow the steps to delete all history.

You might need to configure username and email and provide the credentials for your GitHub account. You can also check the list of git commands for your regular use.

That’s it for today.
Thank you for reading. Happy Coding..!! 🙂

If you found value in this article,
you can support us by buying me a coffee! ☕

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *