脚本遍历目录

BAT

for /d %%a in (*) do (
echo %%~a
cd %%~a
git fetch
git checkout develop
git pull
cd ..
)
pause

批量初始化git仓库

for /d %%a in (*) do (
echo %%~a
cd %%~a
echo http://gitlab.shocksoft.com/xxx/xxx/%%~a.git

git init --initial-branch=main
git remote add origin http://gitlab.shocksoft.com/xxx/xxx/%%~a.git
git add .
git commit -m "Initial commit"
git push -u origin main

git checkout -b develop
git push --set-upstream origin develop:develop
cd ..
)
pause

批量合并

for /d %%a in (*) do (
echo %%~a
cd %%~a
git checkout main
git merge --no-ff develop
git commit -am "merge dev"
git push
git checkout develop
cd ..
)
pause

posted @ 2022-12-26 13:34  Ranger-dev  阅读(20)  评论(0编辑  收藏  举报