-->
  • Recent Articles

    How to create a personal access token (PAT) in GITHUB

     You need to create  personal access tokens to use in place of a password with the command line or with the API. As a security precaution, GitHub automatically removes personal access tokens that haven't been used in a year.

    Create a token

    1. In the upper-right corner of any page, click your profile photo, then click Settings.

    2. In the left sidebar, click Developer settings.

    3.  In the left sidebar, click Personal access tokens.4. Click Generate new token.
    git PAT


    5.  Give your token a descriptive name. To give your token an expiration, select the Expiration drop-down menu, then click a default or use the calendar picker.
    GIT PAT Name
       
    6. Select the scopes, or permissions, you'd like to grant this token and  Click Generate token.
    GIT PAT scopes
    GIT PAT scopes

    Your Token should look like this.

    Using a token on the command line

    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
    [root@devopszones ~]#git clone https://github.com/manastri/node-webapp.git
    Cloning into 'node-webapp'...
    Username for 'https://github.com': manastri
    Password for 'https://manastri@github.com':
    remote: Enumerating objects: 11, done.
    remote: Counting objects: 100% (11/11), done.
    remote: Compressing objects: 100% (9/9), done.
    remote: Total 11 (delta 0), reused 0 (delta 0), pack-reused 0
    Unpacking objects: 100% (11/11), done.
    [root@devopszones ~]#

    No comments