#!/bin/sh ##This bash file can update all git project in given directory echo"Please input your name: " read name echo"You had input name: $name"
echo"Please input your email: " read email echo"You had input email: $email"
#in case this file being invoked form other path base_dir=$(dirname "$0") #a tool script for colorful output
cd$base_dir
#read given directory as repositories directory, #or current directory project_dir="." if [ ! -z $1 ] then project_dir=$1 fi
if [ ! -d $project_dir ] then echo"$project_dir is not a directory." exit 1 fi
echo"Set repository base directory to $project_dir"
for project in `ls $project_dir` do if [ -d $project ] then cd$project #update git repository if [ -d '.git' ] then echo"Setting project:$project" git config --local user.name "$name" git config --local user.email "$email" echo"Done." echo else echo"$project is not a repository.\n" fi cd .. fi done exit 0
#!/bin/sh ##This bash file can update all git project in given directory #in case this file being invoked form other path base_dir=$(dirname "$0") #a tool script for colorful output
cd$base_dir
#read given directory as repositories directory, #or current directory project_dir="." if [ ! -z $1 ] then project_dir=$1 fi
if [ ! -d $project_dir ] then echo"$project_dir is not a directory." exit 1 fi
echo"Set repository base directory to $project_dir"
for project in `ls $project_dir` do if [ -d $project ] then cd$project #update git repository if [ -d '.git' ] then echo"Updating project:$project" git pull --all echo"Done." echo #update svn repository optional elif [ -d '.svn' ] then echo"Updating project:$project" svn update echo"Done." echo else echo"$project is not a repository.\n" fi cd .. fi done exit 0