Skip to content

Instantly share code, notes, and snippets.

@philpennock
Created November 13, 2013 01:59
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save philpennock/7442294 to your computer and use it in GitHub Desktop.
Save philpennock/7442294 to your computer and use it in GitHub Desktop.
git: Push a branch to a group of remotes
#!/bin/sh
groupname="${1:?Need a group to push to}"
branch="${2:-master}"
for r in $(git config "remotes.${groupname}"); do
echo >&2 "Pushing '${branch}' to '${r}'"
git push "$r" "$branch"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment