Skip to content

Commit faa5d91

Browse files
committed
add gitb script
1 parent 54c1089 commit faa5d91

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

bin/gitb

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#!/bin/zsh
2+
3+
# Count the total affected directories
4+
function gitb() {
5+
TOTAL_NUM=0
6+
7+
# Traversal all the items in current directory, find the directories which contains .git
8+
for dir in $(ls); do
9+
if [ -d "$dir/.git" ]; then
10+
cd $dir
11+
TOTAL_NUM=$(expr $TOTAL_NUM + 1)
12+
echo ---------------------$dir---------------------
13+
git $*
14+
echo ""
15+
cd ..
16+
fi
17+
done
18+
19+
echo "Total $TOTAL_NUM directories completed."
20+
}
21+
gitb "$@"

0 commit comments

Comments
 (0)