When we renamed our github organization the entire (rather large) team had to manually update the remote URLs which proved to be a daunting task. I created git-url-sub to make this easier.

Install using Homebrew on OS X:

brew install git-url-sub

Install from source:

git clone git://
cd git-url-sub
sudo make install


git url-sub [options] pattern replacement


To replace first occurrences of foo in the remote url with bar

$ git url-sub foo bar # will dry run

. origin (fetch) ->
. origin (push) ->

NOTE: No changes have been made. Please run with -c flag to commit changes

$ git url-sub -c foo bar # commit once you are satisfied with changes

. origin (fetch) ->
. origin (push) ->

Changes have been made to the above urls

Like it? You can Tweet about it or (and) follow me on Twitter for updates.