Unable to delete commit history of repository #23903
-
I tried deleting the commit history of my repository on github. I found instuctions on doing this at the link below :
How to Delete Your Repository Commit History on GitHubTypically, you should never delete your commit history. However, if you’re working on your own project or a repository that isn’t used by… Reading time: 5 min read To this date I have been unsuccessful. I was forced to make the repository private. any help will be appreciated |
Beta Was this translation helpful? Give feedback.
Replies: 6 comments
-
There are so many scenarios on deleting history; what exactly are you trying to do? Deleting last 3 commits? Are they pushed to remote? Deleting a specific commit back in history 5 commits back from HEAD? Last I recall, this site was useful walking someone through several scenarios. Disclaimer it’s been several years since I’ve tried this out, but it should be accurate. Hope that helps! |
Beta Was this translation helpful? Give feedback.
-
sachavieuxroy:
As @bretonics mentioned, there are many ways to go about. I personally find that the simplest way is apply all the changes you want and then squash all commits together, which results in the repository history being re-written as there was ever only just on commit, you then only need to As the article you linked mentions, rewriting history on the main branch of a repository is usually a bad idea. If by “deleting” you mean resetting the repository to a pristine state (as if it was a new one, without history), then you only need to delete all contents (including the |
Beta Was this translation helpful? Give feedback.
-
Deleting the complete commit history of the repository except for the very last commit. There currently 16 commits total in the repository. |
Beta Was this translation helpful? Give feedback.
-
Just do an interactive rebase of the whole history and make them all fix ups to a single commit. Then force push it. |
Beta Was this translation helpful? Give feedback.
-
can you give me an example on how to do this? |
Beta Was this translation helpful? Give feedback.
-
Here’s some docs that should help, the first one is eclipse/eGit specific but may still help you to understand the process:
How to Rebase Interactive With Eclipse (eGit)How to Rebase Interactive With Eclipse (eGit): 20180718 - I "think" I've sorted out the issue with the images. If they appear zoomed in or don't make sense, try clicking. If you encounter an issue fire me a message and I'll try to help out.This...
Beginner’s Guide to Interactive Rebasing | Hacker Noon |
Beta Was this translation helpful? Give feedback.
Here’s some docs that should help, the first one is eclipse/eGit specific but may still help you to understand the process:
How to Rebase Interactive With Eclipse (eGit)
How to Rebase Interactive With Eclipse (eGit): 20180718 - I "think" I've sorted out the issue with the images. If they appear zoomed in or don't make sense, try clicking. If you encounter an issue fire me a message and I'll try to help out.This...