我想使用GitPython编写一个批量克隆脚本,但是我找不到处理git url不存在、下载中断等情况的有效示例。
我该如何实现这个功能呢?
以下是我的现有代码:
giturl = 'https://github.com/'+username+'/'+hwName+'.git'
targeturl = os.path.join(hwfolder,username+'-'+hwName)
try:
repo = Repo.clone_from(giturl, targeturl, branch='master')
except:
#git url not reachable
#download interupt
#target local path problem
KeyboardInterrupt
。) - torek