-
Notifications
You must be signed in to change notification settings - Fork 362
Translate 07-git-tools reset v2 #168
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
Conversation
These commands are two of the most confusing parts of Git when you first encounter them. | ||
They do so many things, that it seems hopeless to actually understand them and employ them properly. | ||
For this, we recommend a simple metaphor. | ||
在继续到更特定的工具前,让我们讨论一下 `reset` 与 `checkout`。 |
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.
“在继续了解更专用(专业?)的工具前,我们先讨论一下 reset
和 checkout
。”
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.
同意”专业“。
@@ -46,15 +46,15 @@ $ git ls-tree -r HEAD | |||
040000 tree 99f1a6d12cb4b6f19... lib | |||
---- | |||
|
|||
The `cat-file` and `ls-tree` commands are ``plumbing'' commands that are used for lower level things and not really used in day-to-day work, but they help us see what's going on here. | |||
`cat-file` 与 `ls-tree` 命令是底层命令,是用于底层事物并不在日常工作中使用,但是它们帮助我们看到这里发生了什么。 |
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.
cat-file
与 ls-tree
是底层命令,他们一般用于底层工作,在日常工作中并不使用。不过它们能帮助我们了解到底发生了什么。
It would be exactly like `git reset --hard [branch] file` (if `reset` would let you run that) – it's not working-directory safe, and it does not move HEAD. | ||
另外运行 `checkout` 的方式是有一个文件路径,像 `reset` 一样,不会移动 HEAD。 | ||
它就像 `git reset [branch] file` 那样用那次提交的那个文件来更新索引,但是它也会覆盖工作目录中的那个文件。 | ||
它就像是 `git reset --hard [branch] file`(如果 `reset` 允许你那样运行)- 这不是工作目录安全的,它也不会移动 HEAD。 |
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 reset --hard [branch] file
(如果 reset
允许你这样运行的话)- 这样对工作目录并不安全,它也不会移动 HEAD。
审阅之前先膜拜一下@OlingCat ,没看错的话 143 行有 135 个提议……扑通 |
No matter what form of `reset` with a commit you invoke, this is the first thing it will always try to do. | ||
With `reset --soft`, it will simply stop there. | ||
不论调用了任何形式的有一个提交的 `reset`,这都是它始将尝试去做的第一件事。 | ||
使用 `reset --soft`,它将会只是停在那儿。 |
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.
它将仅仅停在那儿。
……话说终于找到一个没有 note 的行了。。。
@networm 已审核完毕,并提出 13 个修改意见。 |
@OlingCat @IceNature @Geno1024 已修正。 |
@@ -46,15 +46,15 @@ $ git ls-tree -r HEAD | |||
040000 tree 99f1a6d12cb4b6f19... lib | |||
---- | |||
|
|||
The `cat-file` and `ls-tree` commands are ``plumbing'' commands that are used for lower level things and not really used in day-to-day work, but they help us see what's going on here. | |||
`cat-file` 与 `ls-tree` 是底层命令,他们一般用于底层工作,在日常工作中并不使用。不过它们能帮助我们了解到底发生了什么。 |
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.
他们 => 它们
@networm 修订完毕,改完差不多可以合并了。 |
@OlingCat 已修正。 |
No description provided.