我有一個包含單個子模塊(repo2)的git項目(repo1)。 我想實現的是標籤我的項目使用了我的子模塊的一個較舊的提交(如HEAD - 3)。用git標記一個子模塊的舊提交
我試着用子模塊簽出我想要的提交,但結帳是錯誤因爲在我的項目中提交不會跟蹤正確的修訂。 我想我的子模塊復位到提交我想,提交項目,然後拉子模塊,並承諾項目,這也是錯誤的,因爲:
$ git submodule update
fatal: reference is not a tree: 2c3d1a5936aa9469ecc1442cd4b101e1bbd3aada
Unable to checkout '2c3d1a5936aa9469ecc1442cd4b101e1bbd3aada' in submodule path 'repo2'
會是什麼是最好的 - 以及最好的 - 程序?
Git submodule head 'reference is not a tree' error給出了一個答案的開始,但它劇照鏈接repo2的HEAD,而不是選擇提交...
現在假設標籤做的,我怎麼能告訴我repo1到設置repo2處於正常狀態的標籤:
git checkout 0.0.1
根據git submodule update,一個簡單的
git submodule update
應該就足夠了。它不檢查我的子模塊到指定的提交。爲什麼?那是... 錯誤?