Created
June 24, 2016 05:01
-
-
Save houtianze/002d8334acdb4c95a4c2130a276c676d to your computer and use it in GitHub Desktop.
Perform recursive git pulling at the current / given directory
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 | |
pullall() { | |
curdir=`pwd` | |
if [ -d ".git" ] | |
then | |
echo "Git pulling at $curdir" | |
git pull | |
else | |
echo "Skipping non git directory $curdir" | |
fi | |
for f in * | |
do | |
if [ -d "$f" ] | |
then | |
cd "$f" | |
pullall | |
cd .. | |
fi | |
done | |
} | |
# DON'T put in a main(), $# won't wrok | |
if [ $# -eq 0 ] | |
then | |
thedir=`pwd` | |
else | |
thedir="$1" | |
fi | |
echo "Walking at $thedir" | |
cd "$thedir" | |
pullall |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I created this because
go get ./...
won't work for private / SSH git clones.