欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

git 自动拉取脚本

程序员文章站 2022-05-06 19:09:28
...

windows bat

@echo off
setlocal enabledelayedexpansion
cd C:\GitlabSource\test02
for /f %%i in ('git branch -r ^| find /V /I "->"') do (
set "var1=%%i"
set "var1=!var1:/= !"
echo !var1!
set "var2=!var1:origin= !"
echo !var2!
git checkout !var2!
git pull !var1!
)
pause

linux

git branch -r | grep -v '\->' | while read remote; do git branch --track "${remote#origin/}" "$remote"; done
  git fetch --all
  git pull --all

 

相关标签: 系统