meaning of the command “git checkout .” [duplicate

2019-07-27 01:04发布

This question already has an answer here:

While I understand that the command in the title is akin to undo the changes to the current repository, I am unable to understand how it actually works or how to read the command. Any leads would be a great help.

2条回答
SAY GOODBYE
2楼-- · 2019-07-27 01:16

git-checkout - Switch branches or restore working tree files

Example: git checkout -b [branch]

查看更多
ゆ 、 Hurt°
3楼-- · 2019-07-27 01:34

git checkout with <paths> [...] is used to restore modified or deleted paths to their original contents from the index or replace paths with the contents from a named (most often a commit-ish).

See documentation, especially here and here: . is treated as <pathspec> in your case, adressing the current directory. The current HEAD revision of all files in the given <pathspec>, so in your case everything in your base directory, are checked out.

查看更多
登录 后发表回答