【问题标题】:How can I show all versions of my git repository如何显示我的 git 存储库的所有版本
【发布时间】:2020-04-13 14:51:55
【问题描述】:

我在一个项目中工作,我总是在其中制作 npm 版本补丁,今天我希望:

  • 查看所有版本
  • 签出特定版本

【问题讨论】:

    标签: git github gitlab


    【解决方案1】:

    如果您使用标签:

    阅读此答案:What is git tag, How to create tags & How to checkout git remote tag(s)


    签出到特定版本

    选项很少,这里无法描述

    1. 结帐提交

      # checkout any given commit
      git checkout <hash>
      
    2. 恢复提交

      # Reset the working tree to the desired commit
      git reset <HASH/TAG> --hard
      

    【讨论】:

    • git reset 8.11.0 --hard => 输出:致命:不明确的参数“8.11.0”:未知的修订版或路径不在工作树中。使用 '--' 将路径与修订分开,如下所示:'git [...] -- [...]'
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2022-08-03
    • 2014-09-04
    • 2013-02-05
    • 2018-06-19
    • 1970-01-01
    • 2018-10-17
    • 2019-12-11
    相关资源
    最近更新 更多