git-remotes-push.bash 308 B

12345678910111213141516171819202122
  1. #!/bin/bash
  2. ## Este script serve para dar push a todos remotes configurados em um repositório GIT.
  3. pushd `pwd`
  4. REMOTES="`git remote -v | grep -e 'push' | awk '{ print $1 }'`"
  5. BRANCH="master"
  6. if [ ! -z $1 ]
  7. then
  8. BRANCH="${1}"
  9. fi
  10. for REMOTE in ${REMOTES[@]}
  11. do
  12. git push ${REMOTE} ${BRANCH}
  13. done
  14. popd