Created
August 28, 2019 17:43
-
-
Save jrolfs/4949c4097317cdd7fe5b0416032561a9 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
add-fork () { | |
local source_remote=${1:-upstream} | |
local source_url=$(git remote get-url $source_remote) | |
local target_user=${2:-jrolfs} | |
local target_remote=${3:-origin} | |
local target_url=$(sed "s/:.*\//:$target_user\//" <<< $source_url) | |
git remote add $target_remote $target_url | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment