How to configure GitHub credentials
Before being able to clone private repositories or push commits to any repository in GitHub, you first need to setup the credentials for GitHub. There are two ways to authenticate when using GitHub:
- SSH Key: you can connect to GitHub without supplying your username and personal access token
- Personal Access Token: an alternative to using an SSH key
Continue with one of the following two pages depending on which type of authentication you want to use:
NB: There is currently a limitation in using SSH keys on Windows. What works by default is SSH Key authentication on Mac and Linux, and Personal Access Token authentication on Windows. For using SSH keys on Windows, the Pageant authentication agent from PuTTY should be used instead of the ssh-agent present in Windows.
The type of authentication you need also depends on the type of url you use to clone the repository:
- an HTTP url, like
https://github.com/feenkcom/gtoolkit.git, needs a Personal Access Token
- an SCP url, like
email@example.com:feenkcom/gtoolkit.git, needs an SSH key.
When using Metacello baselines and the
github:// protocol in the repository specification the type of url that is used for the clone command depends on the
"Should be #scpURL or #httpsURL"
^ RemoteTypeSelector ifNil: [ RemoteTypeSelector := #scpUrl ]
setting. The default is SCP urls, and in case of authentication errors a retry is done using the HTTPS url.