git项目更新或pull脚本
gitup.sh 更新脚本
giturl.txt git url文件,内容为git地址
#######gitup.sh##start#
#!/bin/sh
WORKDIR=d:/work/
PROJECTSDIR=ws1
cd $WORKDIR
cat giturl.txt|while read gurl
do
gitproject=`echo $gurl|awk -F '/' '{print $NF}'|awk -F '.' '{print $1}'`
echo $gitproject " "$gurl
echo $WORKDIR$PROJECTSDIR"/"$gitproject
if [ -d $WORKDIR$PROJECTSDIR"/"$gitproject ] ; then
cd $WORKDIR$PROJECTSDIR"/"$gitproject
echo $gitproject" pull"
git pull;
else
cd $WORKDIR$PROJECTSDIR"/"
echo $gitproject" clone"
git clone $gurl
fi
done
####end####
###giturl.txt###
git@github.com:mybatis/spring.git