git revert
命令几乎不用,非常不喜欢多出来的 Revert "..."
一条 commit,使历史记录看起来不好看。
本人平时用 git rebase -i
代替 git reset
功能。使用 git rebase -i
可以做到回滚、合并几条 commit、修改 commit 顺序、删除部分 commit 等操作,熟练应用 git rebase -i
很有必要。
使用 git rebase -i
的注意事项
- 多人合作的项目里,不要在主干分支操作,在 feature 分支操作
- 操作之前,备份当前分支
#git #git-rebase #git-reset #git-revert #git-commit