批处理遍历文件夹执行git pull

Windows:

遍历D:\www\这个文件夹,逐个执行git pull,由于跨盘了,必须加上D:

echo off & color 0A

for /d %%f in (D:\www\*) do (
D:
cd %%f
chdir
git pull
)
pause

 

Linux & Mac:

#/bin/bash
path=/data0/www
folderlist=`ls $path|grep -v '^$'`
for i in $folderlist
    do
    cd $path/$i
    git pull

    done

path是你代码的路径

posted @ 2019-12-23 20:50  凌雨尘  阅读(1639)  评论(0编辑  收藏  举报