Skip to content

Instantly share code, notes, and snippets.

View matheusavi's full-sized avatar

Matheus Avi matheusavi

  • Strike
View GitHub Profile
@matheusavi
matheusavi / fix_github_https_repo.sh
Last active March 24, 2021 12:19 — forked from m14t/fix_github_https_repo.sh
Convert HTTPS github clones from all subdirectories to use SSH
#/bin/bash
#Just put this script in the root folder and run it
for d in *; do
if [ -d "$d" ]; then
echo $d
cd $d
REPO_URL=`git remote -v | grep -m1 '^origin' | sed -Ene's#.*(https://[^[:space:]]*).*#\1#p'`
if [ -z "$REPO_URL" ]; then
echo "-- ERROR: Could not identify Repo url."