我想将两个提交不按顺序合并到一个。
例如,如果我执行命令git rebase -i HEAD~3:
pick 8h47n1f Update documentation and release-notes #a
pick 8n32b7a Implemented some random function #b
pick a73ncj1 Update documentation and release-notes #c
Run Code Online (Sandbox Code Playgroud)
我想在推送之前将a和c行合并为一个提交。
我当前完成此任务的方法是按以下方式对提交进行重新排序:
pick 8h47n1f Update documentation and release-notes #a
squash a73ncj1 Update documentation and release-notes #c
pick 8n32b7a Implemented some random function #b
Run Code Online (Sandbox Code Playgroud)
到目前为止,我还没有看到任何危险的副作用。有谁知道我是否真的可以通过这样做破坏某些东西?有没有更好,更安全的方法来完成我要完成的工作?