Skip to content

Instantly share code, notes, and snippets.

@RyujiAMANO
Created May 9, 2019 01:35
Show Gist options
  • Save RyujiAMANO/4d41b7bffccb7519fcb90aa9cb41f2fd to your computer and use it in GitHub Desktop.
Save RyujiAMANO/4d41b7bffccb7519fcb90aa9cb41f2fd to your computer and use it in GitHub Desktop.
gitpull-r
# 元記事がなくなってしまってオリジナルが確認できないけどたぶん。元は下記記事。
# 指定したディレクトリ配下の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