I can use HTTPS and SSH URL's for GitHub repos, thanks to insteadOf
This forces GitHub to always use SSH, even for HTTPS URL’s! This way, you can use https://
GitHub URL’s and they will still use your SSH key.
When cloning an HTTPS URL, it now gets rewritten as an SSH URL. It will instead be fetching from git@github.com
via SSH.
Alternatively, this forces GitHub to always use HTTPS. Great for macOS, where you can use git-credential-osxkeychain to store your GitHub token. This will not rewrite git@github.com:user/repo.git
URL’s, though, so I don’t really recommend it!
Hat tip to these people!
I am a web developer helping make the world a better place through JavaScript, Ruby, and UI design. I write articles like these often. If you'd like to stay in touch, subscribe to my list.