Skip to content

Instantly share code, notes, and snippets.

@jonpugh
Last active October 20, 2021 03:20
Show Gist options
  • Star 32 You must be signed in to star a gist
  • Fork 9 You must be signed in to fork a gist
  • Save jonpugh/5163389 to your computer and use it in GitHub Desktop.
Save jonpugh/5163389 to your computer and use it in GitHub Desktop.
Lots of repos? Try "git-pull-recursive" to run "git pull" on all subfolders with a .git folder inside. Thanks to http://snipplr.com/view/62314/perform-git-pull-on-subdirectory-recursive/
# For use in Chef:
# Adds a command: git-pull-recursive
file "/usr/local/bin/git-pull-recursive" do
owner "root"
group "root"
mode "0755"
action :create
content 'find . -type d -name .git -exec sh -c "cd \"{}\"/../ && pwd && git pull" \;'
end
# For use in a shell:
# Download this file to /usr/local/bin/git-pull-recursive, then chmod 755 it to install git-pull-recursive
find . -type d -name .git -exec sh -c "cd \"{}\"/../ && pwd && git pull" \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment