Delete all commit records from Github without deleting the source

delete-all-commit-records-from-github-without-deleting-the-source/
  1. Do a temporary checkout git checkout --orphan temp
  2. Commit the changes git commit -am "cleaning"
  3. Delete the branch git branch -D main
  4. Rename the current branch to main git branch -m main
  5. Finally, force update your repository git push -f origin main

delete-all-commit-records-from-github-without-deleting-the-source

At times we push the wrong update to the repository. In spite of fixing the issue at a later stage, we just hope that we never have pushed the wrong code. We have a workaround for this. Click here to know How to delete all commit records from Github without deleting the source

 

Leave a comment

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