Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#!/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
You can’t perform that action at this time.