Skip to content

Instantly share code, notes, and snippets.

View gatlinnewhouse's full-sized avatar
🔍
looking for work

Gatlin Newhouse gatlinnewhouse

🔍
looking for work
View GitHub Profile
package main
import (
"fmt"
"io"
"log"
"os"
)
var target_path string
@gatlinnewhouse
gatlinnewhouse / to_https_gitlab.sh
Last active August 6, 2017 02:57 — forked from icyflame/to_https.sh
Convert all GitLab git remotes to SSH or HTTPS.
#/bin/bash
#-- Script to automatically convert all git remotes to HTTPS from SSH for gitlab repos
# Script will change all the git remotes.
# If you didn't intend to do that, run the other script in this repo.
# Original 1: https://gist.github.com/m14t/3056747
# Original 2: https://gist.github.com/chuckbjones/9dc6634fe52e56ba45ac
# Thanks to @m14t, @michaelsilver and @chuckbjones.
ssh_to_https(){
REPO_URL=`git remote -v | grep -m1 "^$1" | sed -Ene's#.*(git@gitlab.com:[^[:space:]]*).*#\1#p'`