3 # Push current commits to all remotes and fetch from all remotes. Then display
4 # unmerged commits and changes in the repositories.
6 # If --local is given as option, no fetching/pushing is performed.
8 # If an argument is given cd to this directory before running the commands.
10 # Very useful to sync multiple remotes.
14 if [ x$1 = x--local ];then
24 if [ x$LOCAL = x ]; then
25 # Get all remote changes.
26 git remote update 2>&1 | grep -v Fetching
27 # Push all local changes to remote(s).
28 for remote in `git remote`; do
29 git push $remote 2>&1 | grep -v 'Everything up-to-date'
32 # Show unmerged changes.
33 git branch -rv --color --no-merged
34 # Show uncommitted changes.
35 if `echo "$1" | grep '\.git\$' > /dev/null`; then
38 git status | grep 'Changes to be committed:' > /dev/null \
39 && echo '-> modified (staged)'
40 git status | grep 'Changed but not updated:' > /dev/null \
42 git status | grep 'Untracked files:' > /dev/null \
43 && echo '-> modified (untracked)'