Created
August 21, 2013 21:01
-
-
Save IchHabRecht/6300228 to your computer and use it in GitHub Desktop.
[GIT] Perform Git update on subdirectories
This file contains hidden or 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 | |
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