git中detaching存在的原因是什么

What is the reason of existance of detaching in git

我已经阅读了 git 文档,但我无法理解在 git 中分离分支的目的是什么。

当您想进行一些更改但又不想让它们成为您的分支的一部分时,您可以分离您的分支。来自 A Visual Git Reference:

When HEAD is detached, commits work like normal, except no named branch gets updated. (You can think of this as an anonymous branch.)

Once you check out something else, say master, the commit is (presumably) no longer referenced by anything else, and gets lost. Note that after the command, there is nothing referencing 2eecb. on the other hand, you want to save this state, you can create a new named branch using git checkout -b name.