首页 > 其他分享 >git 批量克隆工程

git 批量克隆工程

时间:2022-10-08 16:33:09浏览次数:46  
标签:git 克隆 批量 thisProject private subprocess thisProjectURL import

from urllib.request import urlopen

import json

import subprocess, shlex

 

allProjects     = urlopen("https://{your gitlib host}/api/v4/groups/{you group name}/projects?private_token={your git private token}&per_page=100000")

allProjectsDict = json.loads(allProjects.read().decode())

for thisProject in allProjectsDict: 

    try:

        thisProjectURL  = thisProject['http_url_to_repo']

        # ssh 使用  thisProjectURL  = thisProject['ssh_url_to_repo']

        command     = shlex.split('git clone %s' % thisProjectURL)

        resultCode  = subprocess.Popen(command)

 

    except Exception as e:

        print("Error on %s: %s" % (thisProjectURL, e.strerror))

 

 

 

#新建python执行文件 gitBatchClone.py   内容为上述内容

#使用 python3 ./gitBatchClone.py运行

标签:git,克隆,批量,thisProject,private,subprocess,thisProjectURL,import
From: https://www.cnblogs.com/zhanghengscnc/p/16769372.html

相关文章

  • 当上传git 提交出现--Please enter a commit message to explain why this merge is n
    git在pull或者合并分支的时候有时会遇到这个界面。可以不管(直接下面3,4步),如果要输入解释的话就需要:1.按键盘字母i进入insert模式2.修改最上面那行黄色合并信息......
  • Git .gitignore 的使用
    基本语法#直接文件夹名字,忽略该文件夹和目录下的所有文件00面试相关#忽略.class后缀的文件*.classgitignore不生效问题gitrm-r--cached.gitadd.git......
  • QGIS 使用矢量数据(shp)批量裁剪栅格数据(tif)
    前提描述有一种情况是一个矢量数据有多个元素,比如A省有11个市,那么我用A省的矢量去裁剪栅格的时候,想直接输出11个市域独立的栅格结果,也就是输出11个栅格数据,这个在ArcGISPro......
  • https://github.com/succlz123/AcFun-Client-Multiplatform
    GitHub-succlz123/AcFun-Client-Multiplatform:Athirdpartmultipaltformclientofhttps://www.acfun.cn/.Thegoalofthisrepositoryistobuildaonlinemed......
  • Git基本操作
    Git的工作就是创建和保存你项目的快照及与之后的快照进行对比。Git常用的是以下6个命令:gitclone、gitpush、gitadd.、gitcommit、gitcheckout、gitpull。  ......
  • git 合并之后恢复之前版本
    第一步:gitcheckout [分支]   切换到要恢复的分支上gitreflog    查看历史版本号,找到要恢复的版本号gitreset--hard <版本号>  将本地代码回退到指......
  • 实战项目 操作微信批量发送消息
    importtimeimportpandasaspdimportpyautoguiimportpyperclipdata=pd.read_excel("file/社群优质用户奖励发放.xlsx",header=0)person_pass=[]forin......
  • 如何理解git rebase?
    在mergePR的过程中,rebaseandmerge会产生冲突,因此需要补充一下Gitrebase的知识点。​​UnderstandingRebase(AndMerge)inGit​​​​Mergingvs.Rebasing​​webst......
  • CentOS 7.9 安装 git-2.21.0
    地址:https://git-scm.com/https://github.com/git/githttps://mirrors.edge.kernel.org/pub/software/scm/git/安装依赖包 yuminstall-ycurl-dev......
  • 一份工作 6 年前端的 Git 备忘录
    前言熟练的使用git指令,是一个程序员的基本功,本文记录了我这些年常用的一些git操作。进入新团队需要做的一系列git操作高频使用的指令1.注册内网gitLab账户2.项目......