git checkout 命令中点号的含义
如果我像这样使用 git 命令:
git checkout -- .
我知道它的效果是丢弃所有未暂存的文件。
谁能告诉我这个命令中的点号(.)是什么意思?
if I use git command like this:
git checkout -- .
I know its effect is to discard all unstaged files everywhere.
Can anyone tell me what is the meaning of the dot sign (.) in this command?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
点代表当前目录。您提到的命令的意思是:对当前目录进行 git checkout (递归地)。双破折号将选项与文件规范分开(如
.
)。The dot stands for the current directory. The command you've mentioned means: Do a git checkout of the current directory (recursively). The double-dashes separate options from filespecs (like
.
).点 (
.
) 指的是当前工作目录。您要求 git 从签出分支签出当前目录。双破折号用于将引用(例如
master
或HEAD
)与文件路径(例如myfile.cpp
)分开。The dot (
.
) refers to the current working directory.You are asking git to checkout the current directory from the checked out branch. The double-dash is used to separate references, such as
master
orHEAD
from file paths, such asmyfile.cpp
.