在git documentation for the checkout command找到以下文本:
...If no paths are given, git checkout will also update HEAD to set the specified branch as the current branch....
谁能更简单地解释一下这意味着什么?很抱歉,如果它看起来很简单,并且通读该页面,我似乎无法想出它的确切含义。对不起,如果这看起来很基本......
特别是我对 checkout 如何更新 HEAD 感到困惑。我通常设想 check out 会影响工作目录——这是 git 独有的一种能力,因为您正在更新存储库的本地副本以便稍后使用它吗?
最佳答案
版本 A:(指定仅分支)
git checkout <branch>
获取该
版本 B:(仅指定路径)
git checkout <file>
获取最新版本的
关于git - GIT checkout 命令路径的简单说明,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3754637/