Created
February 27, 2018 18:45
-
-
Save lita/9ceebc9844b04b5331c3cb4530a32be3 to your computer and use it in GitHub Desktop.
Fix remote origins
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
set -e | |
for f in *; do | |
if [[ -d $f ]]; then | |
echo $f; | |
cd $f; | |
git remote get-url origin | grep -q '^https://' && git remote set-url origin "$(git remote get-url origin | sed 's|https://github.com/|[email protected]:|')" && echo 'updated!'; | |
cd ..; | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment