Created
June 16, 2020 02:19
-
-
Save neikeq/6228b65530896320c8df0fc6f0e4d114 to your computer and use it in GitHub Desktop.
Scripts to automatically convert URL of all git remotes from HTTPS to SSH and viceversa
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/bash | |
git remote | while read -r REMOTE ; do | |
echo "Converting remote '$REMOTE' to HTTPS" | |
git remote set-url $REMOTE $(git remote show $REMOTE | grep "Fetch URL" | sed 's/ *Fetch URL: //' | sed 's/[email protected]:/https:\/\/github.com\//') | |
done |
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/bash | |
git remote | while read -r REMOTE ; do | |
echo "Converting remote '$REMOTE' to SSH" | |
git remote set-url $REMOTE $(git remote show $REMOTE | grep "Fetch URL" | sed 's/ *Fetch URL: //' | sed 's/https:\/\/github.com\//[email protected]:/') | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment