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'