Created
April 22, 2016 06:04
-
-
Save tkatochin/1245fcde97c164b5d384a1f2dcae892f to your computer and use it in GitHub Desktop.
カレントディレクトリの直下のディレクトリから.gitを持つディレクトリをリストアップし、パラメータで渡したコマンドを各ディレクトリ内で実行する。
This file contains 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
#!/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 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
使い方の例
git-dir-all git branch -vv
とか