'Git Convert All Remotes in a Repo from HTTPS to SSH

Is there a command to programmatically convert all existing remotes on a repo from HTTPS to SSH?

For example, if I had a repo with a remote for GitHub, and another for GitLabs, and they both use HTTPS.



Solution 1:[1]

There is no such command in git. But I agree with @larsks, you can use some small script, for instance with regular expression, to convert.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 demitt