Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
カレントディレクトリの直下のディレクトリから.gitを持つディレクトリをリストアップし、パラメータで渡したコマンドを各ディレクトリ内で実行する。
#!/bin/sh
for dir in `find . -maxdepth 1 -type d`; do
if [ -d $dir/.git ]; then
pushd . > /dev/null 2>&1
cd $dir
echo "======== ${dir##*/} ========"
$*
popd > /dev/null 2>&1
fi
done
@tkatochin

This comment has been minimized.

Copy link
Owner Author

commented Apr 22, 2016

使い方の例

git-dir-all git branch -vv

とか

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.