Created
July 28, 2022 03:55
-
-
Save agausmann/68af9a15eca39f2ae2603848ade72c89 to your computer and use it in GitHub Desktop.
Convert SSH Git URLs to HTTPS
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
for gitdir in $(find $HOME -name .git); do cd "$gitdir/.." 2>/dev/null && ( git remote | grep -q origin ) && (git remote get-url origin | grep -q 'git@github\.com:agausmann' ) && git remote set-url origin "https://github.com/agausmann/$(basename "$(git remote get-url origin)")"; done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Random script that I hacked up to automatically update all my SSH-based origin URLs to HTTPS.