Is there any way to continue Git clone from the point where it failed?

后端 未结 3 379
失恋的感觉
失恋的感觉 2020-12-06 04:35

I was cloning the open embedded project yesterday. Because of connection problems, the cloning failed. I started the command again and cloning started from the beginning.

3条回答
  •  执念已碎
    2020-12-06 05:24

    With poor connectivity between the git server and your local computer, a git clone may continue for many hours and then fail. Restarting the clone just restarts the process, which is likely to fail again.

    As a workaround, use a hosted server that has good connectivity to the git repository and ssh access from your local. Clone to the server, then rsync to your local over ssh, and resume the rsync as needed.

    On your cloud server:

    `git clone -n git://.git`
    

    On your local computer (if fails, repeat to resume):

    `rsync -a -P -e ssh @: `
    

提交回复
热议问题