Git:意外中止后如何继续Git提取?

时间:2018-07-12 21:09:20

标签: git fetch

服务器端的代码很大,大约20GB。 因此下载将花费很长时间。下载超过10GB后,我尝试了几次,服务器意外中止。 我的操作是这样的:

git fetch --depth=100 url
//about 5GB is downloaded
git fetch --unshallow
// download about 10GB more ,the remote hung up unexpectedly

我可以继续下载吗?如果不能,则10GB没用,如何删除它们?

2 个答案:

答案 0 :(得分:2)

如果获取中止,它将不会对您的文件系统进行任何更改。这是因为如果将本地存储库写入计算机,则该存储库将不会处于稳定状态。

无法恢复提取/拉取/克隆,因此您唯一的选择是再次提取。

要清除不必要的文件,请使用git gc

https://git-scm.com/docs/git-gc

答案 1 :(得分:0)

尝试:

$ git gc

从男人那里来

NAME
       git-gc - Cleanup unnecessary files and optimize the local repository
相关问题