-
Notifications
You must be signed in to change notification settings - Fork 14
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(ch5): translate 589-973 #54
base: master
Are you sure you want to change the base?
Conversation
还是啥都没有 | ||
但是我跑 `ls -a` | ||
就会有个隐藏的文件夹 `.git` | ||
* `.` 开头的文件默认隐藏 文件夹是特殊的文件 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* `.` 开头的文件默认隐藏 文件夹是特殊的文件 | |
* `.` 开头的文件默认隐藏 文件夹是特殊的文件 | |
* 至于为啥 `.` 开头的文件表示隐藏,最初来源于 ls 的一个 bug |
然后你要加一个子命令名作为参数 | ||
来指定要看啥的帮助 | ||
我现在跑 `git help init` | ||
它就会告诉我 `git init` 的帮助信息 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
它就会告诉我 `git init` 的帮助信息 | |
它就会告诉我 `git init` 的帮助信息 | |
* 另外两种方法是 `git init --help` 和 `man git-init` |
节点里面是一个 | ||
只有一个文件节点的 blob 树 | ||
这个文件节点的文件名叫做 `hello.txt` | ||
里面写有 `hello world` # REVIEW 树套树套.. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Git 其实是 DAG 套树
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
但是他这里说树(
而且 dag 可以转成有根树吧
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
做不到吧,你考虑 merge 的情况,一定可能存在有一个节点有两个父亲的情况,这必不可能是个树
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
里面写有 `hello world` # REVIEW 树套树套.. | |
里面写有 `hello world` # REVIEW DAG套树 |
学生:这个 `42fb7a2` 是代表一整个树 | ||
还是 `hello` 这个功能 | ||
#REVIEW 也没说啥树= = | ||
好问题 也就是说这个 hash 到底代表什么 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
好问题 也就是说这个 hash 到底代表什么 | |
好问题 也就是说这个 hash 到底代表什么 | |
* 其实是代表一个 object,可能是 commit、blob 或者 tree,这里代表一个 commit; | |
* 一个 commit 包含 commit message、作者、签名、parent commit 的指针(也就是 hash,可能有多个,在 merge 那里会提到)和代表 commit 时仓库状态的 tree; | |
* 一个 tree 包含其所有子节点的指针(即目录下所有文件(tree 和 blob)的指针)和对应节点的名字,也就是说 tree 是 Git 内部对应目录的数据结构; | |
* 一个 blob 包含一个文件的内容 |
把 `git add` 和 `git commit` 分开 | ||
`git commit` 不对整个目录进行快照 | ||
这样设计的原因是 | ||
你通常来说并不想把所有东西加入快照 #REVIEW svn 哈哈 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
别啊,SVN 也是可以设置 ignore 的,只是没 Git 灵活
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ignore 和 stage 还是有区别?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
是,所以说没 git 灵活(Git 可以随时随地随意调整,SVN 必须写死在文件里)
No description provided.