dot sign's meaning in git checkout command

半世苍凉 提交于 2019-11-29 15:26:58

问题


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?


回答1:


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 .).




回答2:


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 or HEAD from file paths, such as myfile.cpp.



来源:https://stackoverflow.com/questions/8275452/dot-signs-meaning-in-git-checkout-command

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!