Skip to content

Instantly share code, notes, and snippets.

@nlacourte
Created April 4, 2014 17:26
Show Gist options
  • Save nlacourte/9979159 to your computer and use it in GitHub Desktop.
Save nlacourte/9979159 to your computer and use it in GitHub Desktop.
Lazy git workdir update
#!/bin/bash -eu
find . -type d -name .git -execdir git fetch --quiet --prune \; , -type d -name .git -execdir git fetch --tags --quiet --prune \; , -type d -name .git -execdir bash -c "test -n \"\$(git for-each-ref --format='%(upstream:short)' \$(git symbolic-ref -q HEAD))\" && git pull --rebase --quiet " \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment