1
0
mirror of synced 2025-12-21 10:57:10 -05:00
Files
docs/content/github/extending-github/git-automation-with-oauth-tokens.md
Laura Coursen 8f964ea2cb GHEC version (#20947)
Co-authored-by: Matt Pollard <mattpollard@users.noreply.github.com>
Co-authored-by: Grace Park <gracepark@github.com>
Co-authored-by: Steve Guntrip <12534592+stevecat@users.noreply.github.com>
Co-authored-by: Robert Sese <sese@github.com>
Co-authored-by: Peter Bengtsson <peterbe@github.com>
Co-authored-by: Rachael Sewell <rachmari@github.com>
2021-10-15 15:41:33 -05:00

1.8 KiB

title, redirect_from, intro, versions, shortTitle
title redirect_from intro versions shortTitle
Git automation with OAuth tokens
/articles/git-over-https-using-oauth-token/
/articles/git-over-http-using-oauth-token/
/articles/git-automation-with-oauth-tokens
You can use OAuth tokens to interact with {% data variables.product.product_name %} via automated scripts.
fpt ghes ghae ghec
* * * *
Automate with OAuth tokens

Step 1: Get an OAuth token

Create a personal access token on your application settings page. For more information, see "Creating a personal access token."

{% tip %}

{% ifversion fpt or ghec %} Tips:

  • You must verify your email address before you can create a personal access token. For more information, see "Verifying your email address."
  • {% data reusables.user_settings.review_oauth_tokens_tip %} {% else %} Tip: {% data reusables.user_settings.review_oauth_tokens_tip %} {% endif %}

{% endtip %}

{% ifversion fpt or ghec %}{% data reusables.user_settings.removes-personal-access-tokens %}{% endif %}

Step 2: Clone a repository

{% data reusables.command_line.providing-token-as-password %}

To avoid these prompts, you can use Git password caching. For information, see "Caching your GitHub credentials in Git."

{% warning %}

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.

{% endwarning %}

Further reading