Created
September 4, 2015 02:00
-
-
Save m-wynn/6a6b37db05a8257868b3 to your computer and use it in GitHub Desktop.
use this
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/zsh | |
add-remote() { | |
local name="$1" | |
local remote="$(git config --get remote.origin.url)" | |
local current="$(echo "$remote" | sed -e 's/.*github.com\://' -e 's/\/.*//')" | |
local url="${remote/$current/$name}" | |
git remote add "$name" "$url" | |
} | |
#usage `add-remote m-wynn` |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment