Last active
December 9, 2018 17:19
-
-
Save antoni/0baa816895d7155c7f41e155e2ee7f70 to your computer and use it in GitHub Desktop.
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
#!/usr/bin/env bash | |
: ' Usage: | |
bash <(wget --quiet --output-document=- https://gist.githubusercontent.com/antoni/0baa816895d7155c7f41e155e2ee7f70/raw) | |
' | |
# Replaces $1 with $2 in the origin named 'origin' of Git repo | |
# Should be executed from inside of the repository folder | |
function replace_in_origin() { | |
REMOTE_URL=$(git ls-remote --get-url) | |
REMOTE_URL=${REMOTE_URL/$1/$2} | |
git remote set-url origin $REMOTE_URL | |
echo "Remote URL changed to "$(git ls-remote --get-url) | |
} | |
replace_in_origin "KreditechSSL" "kreditech" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment