Skip to content

Instantly share code, notes, and snippets.

@lita
Created February 27, 2018 18:45
Show Gist options
  • Save lita/9ceebc9844b04b5331c3cb4530a32be3 to your computer and use it in GitHub Desktop.
Save lita/9ceebc9844b04b5331c3cb4530a32be3 to your computer and use it in GitHub Desktop.
Fix remote origins
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/|git@github.com:|')" && echo 'updated!';
cd ..;
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment