I want to delete all commit history but keep the code in its current state because, in my commit history, there are too many unused commits.
How can I do it?
Is there any git command can do this?
git filter-branch ?
git rebase ?
...
My code is hosted on github.com.
rm -rf .*gitcommand which will delete any file ending with .git. 2) Back out to parent directory and rungit initwhich will initialize .git file by creating a new blank .git file without history 3) rungit add .orgit add *4) rungit commit --all -m "initial commit" 5) rungit --set-upstream origin <git-url>` 6) run ` $ git push --mirror <git-repository-path` This process is going to re write history.