meaning of the command “git checkout .” [duplicate]

岁酱吖の 提交于 2019-12-11 08:15:17

问题


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.


回答1:


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.




回答2:


git-checkout - Switch branches or restore working tree files

Example: git checkout -b [branch]



来源:https://stackoverflow.com/questions/42992997/meaning-of-the-command-git-checkout

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