Robin的主页

Git Study Notes

Basic Usage:

Git 基本用法以及命令详解:图解Git

Git-Submodule: SubModule - Git 中文文档

Git-Rebase: Rebase - Git 中文文档

分支管理策略:Git分支管理策略

Git远程操作详解:Git远程操作详解

Git - stash用法:Git - stash用法


个人 Git 模拟测试:

如图1:

Git log 图

图1 Git log 图

  1. 初始化项目,在 master 分支中加入了 master-branch.txt 文档。
  2. master 分支中派生 A 分支,在 A 分支中创建并提交 a.txt,接着在 A 分支中修改 master-branch.txt 并提交。
  3. 再从 A 分支中派生 B 分支,在 B 分支中创建并提交 b.txt,接着在 B 分支中修改 master-branch.txt 并提交。
  4. 切换到 master 分支,执行 git merge --no-ff A,把 A 分支合并到 master 分支中,成功。
  5. 切换到 B 分支,执行 git rebase master,执行结果如图2,按照提示执行 vim master-branch.txt 解决冲突如图3。
  6. 冲突解决完之后,执行 git add master-branch.txt后再执行 git rebase --continue, rebase 完成如图4。

图2

图2

图3

图3

图4

图4


Git 模拟仓库打包在 testgit.zip 中 。

-EOF-

- - - - - -
written by 陈烨彬 Robin Chen , and published under (CC) BY-NC-SA.