Advertisement
IchHabRecht

[GIT] Perform Git update on subdirectories

Aug 5th, 2013
133
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.18 KB | None | 0 0
  1. #!/bin/sh
  2. find . -type d -name .git -exec sh -c "cd \"{}\"/../ && pwd && if git status | grep -q \"nothing to commit\"
  3. then
  4. git pull
  5. else
  6. git stash && git pull && git stash pop
  7. fi" \;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement