在粉碎这两个承诺之后, 你最终会有一个崭新的承诺 和历史,因为壁球, 完全称为别的东西:
* [cf0149e] (HEAD, branch_2) more editing
* [8fcc106] some edit
|
| * [59e643e] (branch_2b) branch 2b
| /
|/
| * [0f4c880] (branch_2_a) branch 2a
| /
|/
* [a74eb2a] checkout 1
* [9a8dd6a] added branch_2 line
|
| * [cf0149e ] (HEAD , branch_2 ) more editing (post-squash rebase)
| * [8fcc106 ] some edit (post-squash rebase)
| * [SQUASHED] "checkout 1" + "added branch_2 line"
|/
|
| * [bb903de] (branch_3) branch 3
|/
|
| * [674e08c] (branch_1) commit 1
| * [7d3db01] added branch_1 line
|/
* [328454f] (0.0.0) test
注意其他现有分支没有受到影响;因为你所做的一切都是一个新的被压抑的承诺——它不会改变其他任何事物的历史。
您的HEAD现在指向 cf0149e
, 这将有一个新的 SHA1 hash, 因为你已经改变了历史 。
现在,你可以在 SQUASHED
上 rebase
其他分支,一个接一个地生成:
* [cf0149e] (HEAD, branch_2) more editing
* [8fcc106] some edit
|
| * [59e643e] (branch_2b) branch 2b
| /
|/
| * [0f4c880] (branch_2_a) branch 2a
| /
|/
* [a74eb2a] checkout 1
* [9a8dd6a] added branch_2 line
|
| * [cf0149e ] (HEAD , branch_2 ) more editing (post-squash rebase)
| * [8fcc106 ] some edit (post-squash rebase)
| |
| | * [59e643e] (branch_2b ) branch 2b (rebased on SQUASHED)
| | /
| |/
| | * [0f4c880 ] (branch_2_a ) branch 2a (rebased on SQUASHED)
| | /
| |/
| * [SQUASHED] "checkout 1" + "added branch_2 line"
|/
|
| * [bb903de] (branch_3) branch 3
|/
|
| * [674e08c] (branch_1) commit 1
| * [7d3db01] added branch_1 line
|/
* [328454f] (0.0.0) test
旧的历史现在无关紧要,所以我们真的有:
* [cf0149e ] (HEAD , branch_2 ) more editing (post-squash rebase)
* [8fcc106 ] some edit (post-squash rebase)
|
| * [59e643e] (branch_2b ) branch 2b (rebased on SQUASHED)
| /
|/
| * [0f4c880 ] (branch_2_a ) branch 2a (rebased on SQUASHED)
| /
|/
* [SQUASHED] "checkout 1" + "added branch_2 line"
|
| * [bb903de] (branch_3) branch 3
|/
|
| * [674e08c] (branch_1) commit 1
| * [7d3db01] added branch_1 line
|/
* [328454f] (0.0.0) test