dot sign's meaning in git checkout command

前端 未结 2 1819
感动是毒
感动是毒 2021-01-01 00:00

if I use git command like this:

git checkout -- .

I know its effect is to discard all unstaged files everywhere.

Can anyone tell m

2条回答
  •  北荒
    北荒 (楼主)
    2021-01-01 00:57

    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.

提交回复
热议问题