破折号在“ git开关”中是什么意思 - ?
进行结帐时,我收到了此消息:
$ git checkout HEAD~2
Note: switching to 'HEAD~2'.
You are in a 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.
If you want to create a new branch to retain commits that you create, you may
do so (now or later) by using -c with the switch command. Example:
git switch -c <new-branch-name>
Or undo this operation with:
git switch -
git Switch中的破折号是什么意思 -
?它总是以前的分支吗?
When doing checkout, I got this message:
$ git checkout HEAD~2
Note: switching to 'HEAD~2'.
You are in a 'detached HEAD' state. You can look around, make experimental
changes and commit them, and you can discard any commits you make in this
state without impacting any branches by switching back to a branch.
If you want to create a new branch to retain commits that you create, you may
do so (now or later) by using -c with the switch command. Example:
git switch -c <new-branch-name>
Or undo this operation with:
git switch -
What does the dash mean in git switch -
? Is it always the previous branch?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
git switch 表示以下内容:
因此,
-
等效于@{ - 1}
,它代表使用git Switch选择的最后一个提交
或git Checkout
>。The documentation of
git switch
states the following:Thus,
-
is equivalent to@{-1}
which represents the last commit selected withgit switch
orgit checkout
.