Skip to content

Instantly share code, notes, and snippets.

@houtianze
Created June 24, 2016 05:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save houtianze/002d8334acdb4c95a4c2130a276c676d to your computer and use it in GitHub Desktop.
Save houtianze/002d8334acdb4c95a4c2130a276c676d to your computer and use it in GitHub Desktop.
Perform recursive git pulling at the current / given directory
#!/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
@houtianze
Copy link
Author

I created this because go get ./... won't work for private / SSH git clones.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment