One option for github is to use personal access tokens. Just log in to your account and go to your settings (click the dropdown beside your profile picture) then scroll to the bottom of the settings page and you will see a link to "Personal Access Tokens".
Then create a token with full access to repo (the other API access is not important if all you want to do is pull and push).
The token system was created to allow API access to github but it also work with HTTPS links.
Clone your repo using HTTPS instead of SSH (or if it's already SSH then just copy the HTTPS url and replace the SSH url in your .git/config
file). Then edit your .git/config
file and add the access token to the HTTPS url.
The syntax is standard Basic Auth syntax used by web browsers:
https://<YOUR_GITHUB_USERNAME>:<YOUR_ACCESS_TOKEN>@github.com
I use this to allow me to use github with multiple user accounts (for work, for my personal projects, for voluntary work etc.).