You can create your own personal API token (OAuth) and use it the same way as you would use your normal credentials (at: /settings/tokens
). For example:
git remote add fork https://[email protected]/foo/bar
git push fork
.netrc
Another method is to configure your user/password in ~/.netrc
(_netrc
on Windows), e.g.
machine github.com
login USERNAME
password PASSWORD
For HTTPS, add the extra line:
protocol https
To cache your GitHub password in Git when using HTTPS, you can use a credential helper to tell Git to remember your GitHub username and password every time it talks to GitHub.
git config --global credential.helper osxkeychain
(osxkeychain helper
is required),git config --global credential.helper wincred
git config --global credential.helper cache
Related: