项目模块太多,脚本执行git命令
1.git clone(clone.bat)
@echo off
echo start git clone
pause
for /f %%i in (list.txt) do git clone https://域名/gitlab/itst/某一个group/%%i.git %%i
echo 'git clone finish!'
pause
#list.txt为模块名列表,一行一个即可
2.git 其他命令(opera.sh)
#!/bin/bash
# 获取 git 仓库路径
find `pwd` -type d -name ".git" > git_dir.txt
sed -i "s/\/.git/\//g" git_dir.txt
# 循环文件中的路径拉取数据
while read LINE
do
echo $LINE
cd "$LINE"
git fetch && git checkout origin dev && git pull origin sit
done < git_dir.txt
#使用时更换git命令即可