Created
May 9, 2019 01:35
-
-
Save RyujiAMANO/4d41b7bffccb7519fcb90aa9cb41f2fd to your computer and use it in GitHub Desktop.
gitpull-r
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 元記事がなくなってしまってオリジナルが確認できないけどたぶん。元は下記記事。 | |
# 指定したディレクトリ配下のgitリポジトリを再帰的にpullする - 宝石箱 | |
# http://jewelbox.hatenablog.jp/entry/2014/06/01/111339 | |
# 指定したディレクトリ配下を再帰的にgit pullする | |
function gitpull-r(){ | |
if [ $# -ne 1 ]; then | |
echo "gitpull-r <directory>" | |
return | |
fi | |
cdir=`pwd` | |
destdir=`ruby -e 'puts File.expand_path("#{ARGV[0]}")' $1` | |
for gitdir in `find $destdir -name ".git" | sed -e s/\.git$//g` | |
do | |
echo "== git pull results [$gitdir] ==" | |
cd $gitdir | |
git pull | |
done | |
cd $cdir | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment