维护一个 git 项目, 发现里面的 commit 描述都是,修改某某文件,增加某某文件,有没有办法把这些 commit 删除呢?
比方说:
1 代表的是有效的 commit ,注释清楚
0 代表注释不清晰的 commit
1 0 1 0 0 0 0 0 1 0 0 0 0 0 0 0 1
我要如何把注释不清楚的 commit 删掉呢?
怪我咯2017-05-02 09:21:49
The main question is not "delete", but "merge".
git rebase -i <commit hash>
Start from a certain commitpick
修改为 squash
before the commits that need to be merged
Suggestion git checkout -b squash_some_commits
Create a temporary branch to handle this matter. If you make a mistake, delete it and start over.
我想大声告诉你2017-05-02 09:21:49
git rebase
命令http://zhidao.baidu.com/link?url=Q8DXAl3eVJpkBKF9hcmCi0TlKC0Vyu47PuIkfBWviAoACV6wk67ahzJDXPgxsTpJtyz5euQzqTVu_95QAnN9xLazCzMPsC9gBwFT3RifXYO