Configure git submodule for no password (ssh)

If you are leveraging git submodule for Hugh themes and you are accustomed to using git without passwords (via ssh urls), you’ll find that when you add a git submodule, it will be setup for “https urls” and thus prompt you for a password:

$ git push origin master
Username for 'https://github.com': 

This is obviously annoying but easy to fix. You can check the urls for your origin with git remote -v:

$ git remote -v
origin  https://github.com/ahoog42/Mainroad (fetch)
origin  https://github.com/ahoog42/Mainroad (push)

and then simply update the origin with the ssh url:

$ git remote set-url origin git@github.com:ahoog42/Mainroad.git

Now when you git push origin master, the push will occur over ssh and viola, no more passwords.

About Andrew Hoog
I like to tinker in mobile forensics, security, tools development and nodejs. I’m an author, inventor, expert witness and co-founder of NowSecure.