Source From Here
Question
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?
HowTo
Deleting the .git folder may cause problems in your git repository. If you want to delete all your commit history but keep the code in its current state, it is very safe to do it as in the following:
1. Checkout
2. Add all the files
3. Commit the changes
4. Delete the branch
5. Rename the current branch to master
6. Finally, force update your repository
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?
HowTo
Deleting the .git folder may cause problems in your git repository. If you want to delete all your commit history but keep the code in its current state, it is very safe to do it as in the following:
1. Checkout
2. Add all the files
3. Commit the changes
4. Delete the branch
5. Rename the current branch to master
6. Finally, force update your repository
沒有留言:
張貼留言