]> git.rmz.io Git - dotfiles.git/commitdiff
git: add remote-to-ssh alias to convert https? remotes to git@...
authorSamir Benmendil <samir.benmendil@ultrahaptics.com>
Mon, 14 Jan 2019 09:52:45 +0000 (09:52 +0000)
committerSamir Benmendil <samir.benmendil@ultrahaptics.com>
Mon, 14 Jan 2019 09:52:45 +0000 (09:52 +0000)
git/config

index 801601a0c7538f05491da58ab96979ecb3ba429a..28e18e4c60974a901747fda1daa3475b270660ac 100644 (file)
@@ -41,3 +41,5 @@
        rebase = preserve
 [commit]
        verbose = true
+[alias]
+       remote-to-ssh = "!f(){ local r=$1; git remote set-url $r $(git remote get-url $r | sed -r 's,https?://([^/]+),git@\\1:,'); };f"