Git automation with OAuth tokens
You can use OAuth tokens to interact with GitHub via automated scripts.
Step 1: Get an OAuth token
Create a personal access token on your application settings page.
As a security precaution, GitHub automatically removes personal access tokens that haven't been used in a year.
Step 2: Clone a repository
Once you have a token, you can enter it instead of your password when performing Git operations over HTTPS.
For example, on the command line you would enter the following:
$ git clone https://github.com/username/repo.git Username: your_username Password: your_token
To avoid these prompts, you can use Git password caching.
Warning: Tokens have read/write access and should be treated like passwords. If you enter your token into the clone URL when cloning or adding a remote, Git writes it to your .git/config file in plain text, which is a security risk.