avatar

技术小站

老骥伏枥,日行千里

  • 首页
  • Java
  • Web
  • 框架
  • 微服务
  • 架构
  • 数据库
  • 中间件
  • 研发
  • 关于
Home Git 批量拉取(git pull)多个仓库 bat脚本实现
文章

Git 批量拉取(git pull)多个仓库 bat脚本实现

Posted 2023-10-7 Updated 2023-10- 7
By 管理员
4~5 min read

运行前注意

  • 你使用的是 Windows 系统
  • 你需要批量拉取代码的git仓库都在 同一个文件夹下 ,bat脚本也在此文件夹下。
  • 此脚本递归遍历当前路径下的文件夹,直到找到存在 .git 文件的文件夹,然后执行 git pull,然后继续遍历…

git_pull.bat

@echo off
setlocal

@REM normalize the relative path to a shorter absolute path.
pushd "%~dp0"
set repos_path=%CD%
popd

call :find_and_pull %repos_path%
echo. & echo Finished. & pause>nul
goto :EOF

::-------------------------------------
:: @name   find_and_pull
:: @param  %1 base directory to find .git
:: @usage  call :find_and_pull %base_dir%
::-------------------------------------
:find_and_pull
for /d %%i in (%1\*) do (
    cd %%i
    if exist .git (
        echo. & echo [ START git pull FROM ] %%i
        git pull
    ) else (
        call :find_and_pull %%i
    )
)
goto :EOF
工具
工具
License:  CC BY 4.0
Share

Further Reading

Jun 4, 2025

【Windows】ApifoxAppAgent开机启动项删除

✨ApifoxAppAgent 首先建议使用Geek Uninstaller卸载 卸载会检测软件残留痕迹并清除 然而在开机启动项仍然存在名为ApifoxAppAgent残留项

Jun 2, 2025

Windows11 莫名端口占用,而又找不到占用应用的奇怪问题

尝试用命令却找不到任何占用这个端口的程序。 # 49793 请自行替换为实际的端口号 netstat -ano | findstr "49793" Windows系统或某些软件为了实现某些功能,需要预先保留一部分端口。 执行以下命令查看保留端口 netsh int ip show excluded

May 30, 2025

Crack Sublime Text 4.2.0.0 Build 4200

import sys import os NOP = 0x90 offsets_and_values = { 0x00030170: 0x00, 0x000A94D0: NOP, 0x000A94D1: NOP, 0x000A94D2: NOP, 0x000A94D3: NOP,

OLDER

vs code 更改终端

NEWER

git-repo-updater

Recently Updated

  • 【Windows】ApifoxAppAgent开机启动项删除
  • Proxy AI 配置第三方AI模型
  • Windows11 莫名端口占用,而又找不到占用应用的奇怪问题
  • Crack Sublime Text 4.2.0.0 Build 4200
  • 当 SSH 登录 CentOS 7 系统时认证缓慢的解决方案

Trending Tags

Halo 研发 工具 Linux 数据库 Java AI 象棋 Web Docker

Contents

©2025 技术小站. Some rights reserved.

Using the Halo theme Chirpy