使用git checkout命令切换到指定的commit | 您所在的位置:网站首页 › git切换指定版本 › 使用git checkout命令切换到指定的commit |
git checkout命令有很多种用法。 git checkout + 分支名,切换到指定的分支。比如git checkout develop: 切换之后,HEAD文件的内容: ref: refs/heads/develop git checkout + 文件夹丢弃工作区域中指定文件夹下面的修改: git checkout + commit id切换到指定的commit上去。 You are in ‘detached HEAD’ state. You can look around, make experimental changes and commit them, and you can discard any commits you make in this state without impacting any branches by performing another checkout. If you want to create a new branch to retain commits you create, you may do so (now or later) by using -b with the checkout command again. Example: git checkout -b HEAD is now at 7bda819fd fix: organization library should compile without core style library (#9637) 现在HEAD文件的内容: 7bda819fdf88bd171f63bcc155b8002b6d2a2a8e 更多Jerry的原创文章,尽在:“汪子熙”: |
今日新闻 |
推荐新闻 |
专题文章 |
CopyRight 2018-2019 实验室设备网 版权所有 |