From 08bb89b9ace88818e13c61d17f1de53a51938a32 Mon Sep 17 00:00:00 2001 From: "Azalea (on HyDEV-Daisy)" Date: Mon, 25 Jul 2022 01:55:07 -0400 Subject: [PATCH] [F] Fix git switch --- scripts/python/git-switch.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/scripts/python/git-switch.py b/scripts/python/git-switch.py index 7bd4477..53c444e 100755 --- a/scripts/python/git-switch.py +++ b/scripts/python/git-switch.py @@ -10,6 +10,8 @@ print(f'Current url: {url}') if url.startswith('http'): print('> HTTP git remote detected, switching to SSH') repo = url.split('github.com/')[-1] + if repo.endswith('.git'): + repo = repo[:-4] print(f'> Repo detected: {repo}') new_url = f'git@github.com:{repo}.git'