-
Notifications
You must be signed in to change notification settings - Fork 80
Git SSH support #31
Comments
@hugomd could you elaborate? ✌️ |
@henrikdahl If I This works fine if I've cloned using HTTPS, and opens my browser and takes me to the repository. If I've cloned using SSH then it opens a new terminal window rather than opening the browser. |
@hugomd are you saying it currently opens a new terminal window when you've cloned with SSH or that it's the expected behavior you'd like to see? |
@henrikdahl It opens a new terminal window when I've cloned with SSH and click on |
@hugomd mind sharing how your remote url looks? |
It should already do what you're suggesting, which is why it would be useful to see what your remote url looks like. I'm closing this for now ✌️ |
@henrikdahl Totally missed this, sorry! It seems to work for GitHub, but not GitLab — I'll look into it myself and see if I can work it out myself and maybe make a PR. |
@henrikdahl Found it. Issue is caused by L167. If the git remote uses any port other than 22 it won't work. E.g. > remote = "ssh://git@git.hu.md:1022/hugo/dotfiles.git";
'ssh://git@my.hosted.git:1022/hugo/myrepo.git'
> curRemote = remote.trim().replace(/^git@(.*?):/, 'https://$1/').replace(/[A-z0-9\-]+@/, '').replace(/\.git$/, '');
'ssh://my.hosted.git:1022/hugo/myrepo' Expected output should be: |
I'm running a self-hosted instance of GitLab, which uses a different port. When you do that, GitLab pops ssh:// in front of it. |
So I'm not sure how to solve this. However the port part is identical to the username part.
Since a username can be numbers as well, there's really no way to identify which it is. Any suggestion for a pattern thats consistent? ✌️ |
You could check to see if it starts with There might be a simpler way though |
Someone could have |
@henrikdahl That's true — I'm not sure how I'd recommend fixing it then. I'll try changing my GitLab port to 22 for now! 👍 Thanks for dealing with the issue! |
@henrikdahl Is the port always followed by a |
@hugomd Problem is that a username could be numbers and follow the exact same pattern. |
@henrikdahl I understand that but |
It would be nice if clicking the branch name took you to the branch if the remote is git via SSH rather than HTTPS.
The text was updated successfully, but these errors were encountered: