Skip to content

Instantly share code, notes, and snippets.

@arvinsim
arvinsim / get_git_remote_origins
Created March 3, 2015 05:41
A hacky script to get the remote origins of the git repositories of in the current directory
import os
import subprocess
import re
currentdir = os.getcwd()
filename = currentdir + "/git_submodule_commands.sh"
pattern = re.compile("(?P<push_url>Push\s+URL):\s+(?P<url>https.*)")
# Check if file exists. If it does, delete it.
if os.path.isfile(filename):