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