Fixing github URLs from https to ssh by awesome Sparrow plugin

Alexey Melezhik - Aug 20 '21 - - Dev Community

... For those who are tired of doing this manually like me


Step 1

tom --profile git@github-url-https-to-ssh
Enter fullscreen mode Exit fullscreen mode

output:

install git@github-url-https-to-ssh ...
Enter fullscreen mode Exit fullscreen mode

Step2

tom github-url-https-to-ssh
Enter fullscreen mode Exit fullscreen mode

output:

[repository] :: index updated from file:///root/repo/api/v1/index
[repository] :: plugin /root/sparrow6/plugins/git-url-https-to-ssh installed locally, nothing to do here
[fix-https-ssh] :: stderr: ++ git remote show origin
[fix-https-ssh] :: * remote origin
[fix-https-ssh] ::   Fetch URL: https://github.com/melezhik/sparrowdo.git
[fix-https-ssh] ::   Push  URL: https://github.com/melezhik/sparrowdo.git
[fix-https-ssh] ::   HEAD branch: master
[fix-https-ssh] ::   Remote branches:
[fix-https-ssh] ::     brezeleisen tracked
[fix-https-ssh] ::     master      tracked
[fix-https-ssh] ::   Local branch configured for 'git pull':
[fix-https-ssh] ::     master merges with remote master
[fix-https-ssh] ::   Local ref configured for 'git push':
[fix-https-ssh] ::     master pushes to master (up to date)
[task-check] :: stderr: ++ set -e
[task-check] :: stderr: ++ git remote remove origin
[task-check] :: stderr: ++ git remote add origin git@github.com:melezhik/sparrowdo.git
[task check] stdout match <^^ \s* 'Fetch URL:' \s* (\S+)> True
[task check] url found: [https://github.com/melezhik/sparrowdo.git]
[task check] host found: [github.com]
[task check] project found: [sparrowdo]
[task check] user found: [melezhik]
[task check] change to from [https://github.com/melezhik/sparrowdo.git] to [git@github.com:melezhik/sparrowdo.git]
Enter fullscreen mode Exit fullscreen mode
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
Terabox Video Player