暂停 git clone 并稍后恢复?
有没有办法暂停 git clone 并稍后恢复?我正在克隆一个非常大的存储库(大约 2GB),并且我的电脑已经打开了 40 多个小时。我稍后还有课要赶,我不想就这样离开。有人有主意吗?顺便说一句,它已经达到了 67%。 :(
Is there a way to pause git clone and resume it later? I'm cloning a really big repo (around 2GB) and my PC's been turned on for more than 40 hours. I have school to catch later, I don't want to leave it like this. Anybody got an idea? It's already at 67% btw. :(
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
根据您的情况(例如,如果您想关闭笔记本电脑和/或切换网络),停止该过程(使用
Ctrl-Z
)并恢复它(使用fg
)可能适合你。Depending on your situation (e.g. if you want to close your laptop and / or switch networks), stopping the process (using
Ctrl-Z
) and resuming it (usingfg
) might work for you.假设这是一个普通的 git 克隆,据我所知,恐怕它们是不可恢复的。添加对可恢复的
git clone
/git fetch
的支持一直是过去 Google Summer of Code 的建议项目。一个例外是,如果您实际上正在执行 git svn clone ,那么您可以通过更改到目录并运行 git svn fetch 来重新启动它,但我认为这是只是您正在克隆的普通 git 存储库。有关如何解决此问题的其他一些想法,您可能需要尝试此问题的答案中的建议:
Assuming it's a normal
git clone
, I'm afraid that they're not resumable, as far as I know. To add support for resumablegit clone
/git fetch
has been a suggested project for the Google Summer of Code in the past.One exception is if you're actually doing a
git svn clone
, then you can restart it by changing into the directory and runninggit svn fetch
, but I assume that this is just a normal git repository you're cloning. For some other ideas of how to work around this, you might want to try the suggestions in the answers to this question: