File tree Expand file tree Collapse file tree 1 file changed +10
-10
lines changed
book/02-git-basics/sections Expand file tree Collapse file tree 1 file changed +10
-10
lines changed Original file line number Diff line number Diff line change 230
230
231
231
==== 检出标签
232
232
233
- 如果你想查看某个标签所指向的文件版本,可以使用 `git checkout` 命令,虽然说这会使你的仓库处于“ detacthed HEAD” 状态——这个状态有些不好的副作用:
233
+ 如果你想查看某个标签所指向的文件版本,可以使用 `git checkout` 命令,虽然说这会使你的仓库处于分离头指针( detacthed HEAD) 状态——这个状态有些不好的副作用:
234
234
235
235
[source,console]
236
236
----
237
237
$ git checkout 2.0.0
238
- Note: checking out '2.0.0'.
238
+ 注意: 正在检出 '2.0.0'。
239
239
240
- You are in 'detached HEAD' state. You can look around, make experimental
241
- changes and commit them, and you can discard any commits you make in this
242
- state without impacting any branches by performing another checkout.
240
+ 您正处于分离头指针状态。您可以查看、做试验性的修改及提交,并且您可以通过另外
241
+ 的检出分支操作丢弃在这个状态下所做的任何提交。
243
242
244
- If you want to create a new branch to retain commits you create, you may
245
- do so (now or later) by using -b with the checkout command again. Example:
246
243
247
- git checkout -b <new-branch>
244
+ 如果您想要通过创建分支来保留在此状态下所做的提交,您可以通过在检出命令添加
245
+ 参数 -b 来实现(现在或稍后)。例如:
248
246
249
- HEAD is now at 99ada87... Merge pull request #89 from schacon/appendix-final
247
+ git checkout -b <新分支名>
248
+
249
+ HEAD 目前位于 99ada87... Merge pull request #89 from schacon/appendix-final
250
250
251
251
$ git checkout 2.0-beta-0.1
252
252
Previous HEAD position was 99ada87... Merge pull request #89 from schacon/appendix-final
253
253
HEAD is now at df3f601... add atlas.json and cover image
254
254
----
255
255
256
- 在“detached HEAD”状态下,如果你做了些更改然后提交它们 ,标签不会发生变化,但你的新提交将不属于任何分支,并且将无法访问,除非确切的提交哈希。因此,如果您需要进行更改——比如说你正在修复旧版本的错误——你通常需要创建一个新分支:
256
+ 在分离头指针状态下,如果你做了某些更改然后提交它们 ,标签不会发生变化,但你的新提交将不属于任何分支,并且将无法访问,除非确切的提交哈希。因此,如果您需要进行更改——比如说你正在修复旧版本的错误——你通常需要创建一个新分支:
257
257
258
258
[source,console]
259
259
----
You can’t perform that action at this time.
0 commit comments