2017-05-24 42 views
0

我要在github上克隆Android回購,但是其中一個文件夾volley無法克隆,它總是空的。 我如何克隆整個git回購

我認爲volley是從https://github.com/google/volley,所以我怎樣才能下載整個回購。我曾嘗試使用git clone --recursive,但它表示fatal: no submodule mapping found in .gitmodules for path 'SimpleZhihuDaily/volley'

+0

您需要運行git submodule init和git submodule update –

回答

1

您確實克隆了整個存儲庫。 volley文件夾是一個git子模塊,它指向另一個存儲庫。通常,--recursive會告訴git在克隆存儲庫時獲取所有子模塊(以及這些子模塊的子模塊)。但是,錯誤消息表明子模塊存儲庫存在問題。它看起來像存儲庫no longer exists

如果這確實是您認爲的Google volley存儲庫,請嘗試克隆存儲庫而不使用--recursive。然後編輯.gitmodules並將排球入口的路徑更改爲https://github.com/google/volley.git。然後運行

git submodule update --init --recursive 

如果Google存儲庫包含與存儲庫指向的相同的提交,那麼您將很好。

+0

嗨,感謝您的幫助,但是我找不到任何名爲'.gitmodules'的文件,這是否意味着我需要創建一個名爲'.gitmodules'的新文件? – Jiahao

+0

是的,基於錯誤消息,它聽起來像存儲庫已損壞。你能否在你的問題中添加一個到版本庫的鏈接? –

+0

是的,我仍然無法弄清楚,我找不到git定義'volley'的地址。 [鏈接](https://github.com/Jameeeees/Simplified-Zhihu-Daily) – Jiahao