【问题标题】:how do I access content of a submodule in github?如何访问 github 中子模块的内容?
【发布时间】:2016-11-27 23:09:26
【问题描述】:

我不知道怎么做,但我不知何故把一个文件变成了一个子模块。所以现在我无法在 Github 中查看它。如何撤消此操作以使文件再次可点击?

(我已经阅读了stackoverflow中类似问题的答案,它们对我来说没有多大意义......我对git很陌生)

【问题讨论】:

    标签: github


    【解决方案1】:

    您要么需要revert to a past commit where that file was not a submodule:

    git log path/to/file
    git checkout <past_commit> -- path/to/file
    

    或者您可以删除该条目并恢复文件,添加并再次提交。

    git rm -- path/to/file
    # copy the file
    git add -- path/to/file
    git commit -m "restore file"
    

    【讨论】:

      猜你喜欢
      • 2020-01-08
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-12-05
      • 1970-01-01
      • 2015-03-26
      • 2019-04-05
      • 2019-02-19
      相关资源
      最近更新 更多