daily commit

This commit is contained in:
2022-04-13 15:53:57 +08:00
parent 1763f67e34
commit 9e408f7516
15 changed files with 770 additions and 704 deletions

View File

@@ -207,4 +207,11 @@
* git rebase复杂操作
```shell
# 调用git rebase可以将一个分支基于另一个分支的改变replay到第三分支上
$ git rebase --onto target-branch base-branch topic-branch
$ git rebase --onto target-branch base-branch topic-branch
```
* 相较于mergerebase操作可能会产生一些问题。
* 如一个分支已经被push到远程库且被其他协作者pull并在此基础之上进行开发工作。那么当分支的创建者在本地对分支进行rebase操作后再用git push --force命令对远程分支的history进行覆盖时那么其他协作者对更新之后的远程库进行pull操作merge操作会破坏history
* rebase操作的守则
* 一个rebase操作只能再本地库进行
* 一旦分支被push到远程库就有可能被其他开发者clone并在此基础之上进行修改
* 如果分支被push到远程库后那么就无法再进行rebase操作。因为rebase操作可能会破坏已有的history结构如果用git push --force强制覆盖remote仓库的hsitory结构那么其他开发者再次pull的时候就会进一步破坏history结构