#!/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" \;