Git 还不怎么熟 , 我想问下 .
历史提交的commit , 如果以后这个项目目录太大 , 可以把一些历史状态删掉吗 ?
这样可以节省很多空间
我想大声告诉你2017-05-02 09:24:25
为情所困2017-05-02 09:24:25
Yes, you can find it just by searching
git reset --hard <commit_id>
git push origin HEAD --force
But I really don’t recommend doing this.
大家讲道理2017-05-02 09:24:25
@AlexChen has already said to do it through the reset command:
git reset --hard <SOME-COMMIT>
The effect of this command is to undo all commits after this commit. You can also do it through the revert command:
git revert <SOME-COMMIT>
The effect is to cancel a certain submission.
This is indeed very risky, so be careful.
PHPz2017-05-02 09:24:25
In my impression, the rebase command can merge redundant commits
http://www.ruanyifeng.com/blog/2015/08/git-use-process.html
Refer to this article
仅有的幸福2017-05-02 09:24:25
means git commit
just save file changes, so it won’t take up much space