0
我克隆了一个存储库,并执行了一些本地更改。如何撤销已提交的子模块命令
然后我做了一个git pull origin
从原点获取更新的更改。然后我做一个git push
推到我的克隆库。然而,子模块未按:
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
typechange: third_party/aten (new commits)
modified: third_party/cub (new commits)
modified: third_party/eigen (new commits)
modified: third_party/gloo (new commits)
modified: third_party/nccl (new commits)
我不知道我可以使用git submodule update
更新它们。我添加了他们,承诺并推送到我的克隆库。
这是错误的。我的克隆存储库落后于原点。现在我有一个拉来源的请求,并提交包括在内。
只是想知道是否有一个简单的方法来撤消。强制我的克隆存储库使用与原点相同的版本。
非常感谢!
感谢您的建议。这个问题不是最后一次提交,而是之前的许多提交。我想你的建议会失去所有提交的后续内容。有没有办法只更改子模块版本,但保持所有其他提交完好?谢谢。 – Fei
ok,然后,一种方法是恢复提交问题'git还原'。其他方法是仅检查子模块文件夹到特定的提交'git checkout remote/branch - '。 –
谢谢。我使用了'git chdeckout remote/branch -',它从远程端拉下了最新的变化。 –
Fei