How to clear the commits of a certain branch in github
高洛峰
高洛峰 2017-05-02 09:25:25
0
2
637

That’s it, I built a github page for a certain repo, which is an additional branch gh-pages. I used the automatic generator of the github web version to generate gh-pages.

Every time I update gh-pages, I will commit something to the gh-pages branch. The problem is that these historical records are of no use to me. I am worried that there are too many commits, taking up space and making them uncomfortable to look at.

Is there any way to erase all the history of this branch?

高洛峰
高洛峰

拥有18年软件开发和IT教学经验。曾任多家上市公司技术总监、架构师、项目经理、高级软件工程师等职务。 网络人气名人讲师,...

reply all(2)
仅有的幸福

Delete this branch and create a new branch with the same name

Ty80

Commit cannot be deleted. Even if you delete the branch, the commit record will not be deleted, so you cannot erase all branch history.
Of course, if you just want to make the branch look prettier, you can consider using git rebaseto compress the commit and then force push the branch

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template