Skip to content

Instantly share code, notes, and snippets.

@polymetis
Last active December 20, 2015 05:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save polymetis/6080428 to your computer and use it in GitHub Desktop.
Save polymetis/6080428 to your computer and use it in GitHub Desktop.
This does all the .git changes we need on preexisting repositories. These changes don't need to committed and this is a destructive process.
#!/usr/bin/env bash
if [ -e .gitmodules ]; then
sed -i 's/https:\/\/github.com\//git@github.com:/g' .git/config
awk '/path =/ { print $3 }' .gitmodules | xargs -imetrasub -P10 bash -c "cd .git/modules/metrasub && sed -i 's/https:\/\/github.com\//git@github.com:/g' config"
else
echo "run this from the top"
exit 1
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment