dotfiles/common/users/homeModules/scripts/http2ssh.sh

12 lines
250 B
Bash
Raw Normal View History

2024-11-26 17:01:58 -05:00
set -eo pipefail
if [[ -z $1 ]]; then
echo "You need to provide a remote name";
echo "Avilable remotes";
git remote -v;
exit 1;
fi
URL=$(git remote get-url $1);
URL=${URL/https:\/\//git@};
URL=${URL/\//:};
git remote set-url $1 $URL;