switching from HTTPS to SSH
Communication protocol for github can either be SSH or HTTPS. You can configure protocol to SSH so that ssh key shall be used for authentication. And you do not have to enter password every time you communicate with github.
URL, which includes protocol, is specified in .git/config file.
[remote "origin"]
url = https://github.com/<USERNAME>/<REPO>.git
So as to change URL, use “git remote set-url” command.
$ git remote set-url origin git@github.com:<USERNAME>/<REPO>.git
URL in config file shall be updated as specified in argument abvoe.
[remote "origin"]
url = git@github.com:<USERNAME>/<REPO>.git
Therefore you may be able to configure URL directly by modifying value in config file (not tested though :-)).