只拿到了一個分支一個 commit, 再運行 fetch 也拿不到其他的分支和 commits 了.
嘗試了 git fetch --all
git fetch origin
無效.
用什麼指令來取得完整的倉庫呢?
更新:
搜到一段文章說不能繼續... 不知道是不是真的:
http://strk.keybit.net/blog/2011/06/07/getting-just-the-tip-of-a-remote -git-branch/
A shallow repository (one with short history) cannot be further cloned,
ringa_lee2017-04-24 09:15:04
參考 @Leedy 和 @依雲 的答案, 找出有個 unshallow
參數:
git fetch --help
--unshallow
Convert a shallow repository to a complete one, removing all the limitations imposed by shallow repositories.
PHP中文网2017-04-24 09:15:04
(你們就在評論裡解決問題了?)
$ git version
git version 1.8.5.3
$ git help clone
...
--depth <depth>
Create a shallow clone with a history truncated to the specified
number of revisions. A shallow repository has a number of
limitations (you cannot clone or fetch from it, nor push from nor
into it), but is adequate if you are only interested in the recent
history of a large project with a long history, and would want to
send in fixes as patches.
...
可見 git shallow clone 只能 clone 當前 remote/HEAD 的目錄結構,不包括歷史,因此不是完整的 repo。
However,Git 1.9/2.0 已經去除了這個限制,請參閱 https://github.com/git/git/commit/82fba2b9d39163a0c9b7a3a2f35964cbc039e1a。
參考:http://stackoverflow.com/questions/6941889/is-git-clone-depth-1-shallow-clone-more-useful-than-it-makes-out
PHPz2017-04-24 09:15:04
雷雷
--深度=<深度>
使用 --depth=
選項(請參閱 git-clone(1))加深或縮短由 git clone 建立的淺儲存庫的歷史記錄,以從每個遠端分支歷史記錄的提示開始指定的提交次數。未取得加深提交的標籤。
大家讲道理2017-04-24 09:15:04
git fetch --depth=1000000
stackoverflow上看到個解決辦法,但我嘗試後還是不好使。
http://stackoverflow.com/questions/6802145/convert-shallow-clone-to-full-clone