Frecuentemente publicamos actualizaciones de nuestra documentación. Es posible que la traducción de esta página esté en curso. Para conocer la información más actual, visita la documentación en inglés. Si existe un problema con las traducciones en esta página, por favor infórmanos.
GitHub AE is currently under limited release. Please contact our Sales Team to find out more.

Creating a personal access token

You should create a personal access token to use in place of a password with the command line or with the API.

En este artículo

Personal access tokens (PATs) are an alternative to using passwords for authentication to GitHub Enterprise when using the GitHub API or the command line.

Creating a token

  1. En la esquina superior derecha de cualquier página, da clic en tu foto de perfil y después da clic en Configuración.

    Icono Settings (Parámetros) en la barra de usuario

  2. En la barra lateral izquierda, haz clic en Developer settings (Parámetros del desarrollador).

    Configuración de desarrollador

  3. En la barra lateral izquierda, da clic en Tokens de acceso personal.

    Tokens de acceso personal

  4. Click Generate new token.

    Generate new token button

  5. Give your token a descriptive name.

    Token description field

  6. Select the scopes, or permissions, you'd like to grant this token. To use your token to access repositories from the command line, select repo.

    Selecting token scopes

  7. Click Generate token.

    Generate token button

  8. Click to copy the token to your clipboard. For security reasons, after you navigate off the page, you will not be able to see the token again.

    Newly created token

    Warning: Treat your tokens like passwords and keep them secret. When working with the API, use tokens as environment variables instead of hardcoding them into your programs.

Using a token on the command line

Una vez que tengas un token, puedes ingresarlo en lugar de tu contraseña cuando realices operaciones de Git a través de HTTPS.

Por ejemplo, en la línea de comando ingresarás lo siguiente:

$ git clone https://nombre de host/username/repo.git
Username: your_username
Password: your_token

Personal access tokens can only be used for HTTPS Git operations. If your repository uses an SSH remote URL, you will need to switch the remote from SSH to HTTPS.

If you are not prompted for your username and password, your credentials may be cached on your computer. You can update your credentials in the Keychain to replace your old password with the token.

Further reading

¿Te ayudó este documento?

Privacy policy

Help us make these docs great!

All GitHub docs are open source. See something that's wrong or unclear? Submit a pull request.

Make a contribution

O, learn how to contribute.