Skip to content

Instantly share code, notes, and snippets.

@charlee
Created February 5, 2015 15:28
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 charlee/634e511fa9716fc766fa to your computer and use it in GitHub Desktop.
Save charlee/634e511fa9716fc766fa to your computer and use it in GitHub Desktop.
auto submit to multiple remote
#!/usr/bin/env python
import sys
from subprocess import call
remote = sys.argv[1]
if remote == 'origin':
for line in sys.stdin.readlines():
local_ref, local_sha, remote_ref, remote_sha = line.split(' ')
branch = remote_ref.split('/', 2)[2]
if branch == 'develop' or branch == 'master':
call(['git', 'push', 'anotherremote', branch])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment