有时候想对本地的几个repository都进行一下pull,一个一个操作比较繁琐,所以写了个shell脚本进行简化操作。
git_pull_all.sh
#!/bin/sh clear function showMsg() { echo -e "\033[32m$1\033[0m" } lstRepo=( Project01 Project02 Project03 Project04 ) for repo in ${lstRepo[@]} do cd ../$repo showMsg '开始git pull '$repo git pull done
start_pull.sh
#!/bin/sh clear ./git_pull_all.sh echo echo echo echo echo -e "\033[32m=====================================\033[0m" echo -e "\033[32mPress any key to exit \033[0m" echo -e "\033[32m=====================================\033[0m" read