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'
30 git push --tags $remote 2>&1 | grep -v 'Everything up-to-date'
33 # Show unmerged changes.
34 git branch -rv --color --no-merged
35 # Show uncommitted changes.
36 if `echo "$1" | grep '\.git\$' > /dev/null`; then
39 git status | grep 'Changes to be committed:' > /dev/null \
40 && echo '-> modified (staged)'
41 git status | grep 'Changed but not updated:' > /dev/null \
43 git status | grep 'Untracked files:' > /dev/null \
44 && echo '-> modified (untracked)'