Skip to content

Instantly share code, notes, and snippets.

@IchHabRecht
Created August 21, 2013 21:01
Show Gist options
  • Save IchHabRecht/6300228 to your computer and use it in GitHub Desktop.
Save IchHabRecht/6300228 to your computer and use it in GitHub Desktop.
[GIT] Perform Git update on subdirectories
#!/bin/sh
find . -type d -name .git -exec sh -c "cd \"{}\"/../ && pwd && if git status | grep -q \"nothing to commit\"
then
git pull
else
git stash && git pull && git stash pop
fi" \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment