ITeye博客

Git 深入理解

steeven · 2016-08-22 20:36 · git · 开源软件 · Markdown

从知乎上看到有人推荐这篇文章深入理解GIT, 因为GIT看起来功能很多,其实原理很简单。 GIT from the Bottom up https://jwiegley.github.io/git-from-the-bottom-up/1-Repository/5-the-beauty-of-commits.html

重点:

文件是blob, 相同内容hash一样 tree, 包含几个文件,通常包含在提交里面 tree也可以包含其他tree 提交包含的是tree,和描述 提交可以有多个parent --这个相当于直接merge 每个parent当然可以有多个提交,就成了分支 所谓分支和tag都是commit, 就是一串tree的叠加

评论(1)

  1. #1 楼 · steeven · 2016-08-23 14:22

    Branch总是指向最后的提交 Head是指本地工作目录,checkout分支所指向的commit

    Merge可以在本地和 server, 包含冲突的解决 rebase只能在本地,自己解决冲突,看起来log是直线

评论功能维护中,当前仅展示历史评论。