{"id":7730,"date":"2024-02-20T10:42:09","date_gmt":"2024-02-20T05:12:09","guid":{"rendered":"https:\/\/pheonixsolutions.com\/blog\/?p=7730"},"modified":"2026-09-15T09:50:17","modified_gmt":"2026-09-15T04:20:17","slug":"how-to-create-a-new-token-from-github","status":"publish","type":"post","link":"https:\/\/pheonixsolutions.com\/blog\/how-to-create-a-new-token-from-github\/","title":{"rendered":"How to create a new token from GitHub"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\"><strong>Introduction:<\/strong><\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Personal access tokens (PATs) are an alternative to using passwords for authentication to GitHub when using the GitHub API or the command line. You can create a personal access token to use in place of a password when you are working with GitHub Operations. To generate the personal access token.\u00a0<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Prerequisites<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Before creating a GitHub token, make sure you have:<\/p>\n\n\n\n<ol start=\"1\" class=\"wp-block-list\">\n<li>An active GitHub account.<\/li>\n\n\n\n<li>Access to the GitHub account or organization where the token will be used.<\/li>\n\n\n\n<li>Appropriate permissions to access the required repositories or resources.<\/li>\n\n\n\n<li>A clear understanding of which permissions the token requires.<\/li>\n\n\n\n<li>GitHub access through a web browser.<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">Implementation<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Step 1:<\/strong><br>Click on the profile image of your GitHub account and click on Settings.<\/p>\n\n\n\n<figure class=\"wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-1 is-layout-flex wp-block-gallery-is-layout-flex\">\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2024\/02\/Screenshot-2024-02-17-173807.png\"><img fetchpriority=\"high\" decoding=\"async\" width=\"337\" height=\"341\" data-id=\"7734\" src=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2024\/02\/Screenshot-2024-02-17-173807.png\" alt=\"\" class=\"wp-image-7734\" srcset=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2024\/02\/Screenshot-2024-02-17-173807.png 337w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2024\/02\/Screenshot-2024-02-17-173807-296x300.png 296w\" sizes=\"(max-width: 337px) 100vw, 337px\" \/><\/a><\/figure>\n<\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Step 2:<\/strong><br>Click on Developer Settings<a href=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2023\/12\/Screenshot-2023-12-12-193547.png\"><\/a><\/p>\n\n\n\n<figure class=\"wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-2 is-layout-flex wp-block-gallery-is-layout-flex\">\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2024\/02\/Screenshot-2024-02-17-173941.png\"><img decoding=\"async\" width=\"345\" height=\"200\" data-id=\"7735\" src=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2024\/02\/Screenshot-2024-02-17-173941.png\" alt=\"\" class=\"wp-image-7735\" srcset=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2024\/02\/Screenshot-2024-02-17-173941.png 345w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2024\/02\/Screenshot-2024-02-17-173941-300x174.png 300w\" sizes=\"(max-width: 345px) 100vw, 345px\" \/><\/a><\/figure>\n<\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Step 3:<\/strong><br>Click on Personal access tokens and give tokens (classic). After that, click on Generate new token and give Generate new token (classic).<br><\/p>\n\n\n\n<figure class=\"wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-3 is-layout-flex wp-block-gallery-is-layout-flex\">\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2024\/02\/screenshot5.png\"><img decoding=\"async\" width=\"1024\" height=\"154\" data-id=\"7736\" src=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2024\/02\/screenshot5-1024x154.png\" alt=\"\" class=\"wp-image-7736\" srcset=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2024\/02\/screenshot5-1024x154.png 1024w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2024\/02\/screenshot5-300x45.png 300w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2024\/02\/screenshot5-768x115.png 768w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2024\/02\/screenshot5-1536x230.png 1536w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2024\/02\/screenshot5-850x128.png 850w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2024\/02\/screenshot5.png 1633w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n<\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Step 4:<\/strong><br>Add a name and expiration for your token and select all of the scopes.<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><a href=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2024\/02\/screenshot6.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"521\" src=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2024\/02\/screenshot6-1024x521.png\" alt=\"\" class=\"wp-image-7737\" style=\"width:840px;height:auto\" srcset=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2024\/02\/screenshot6-1024x521.png 1024w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2024\/02\/screenshot6-300x153.png 300w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2024\/02\/screenshot6-768x391.png 768w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2024\/02\/screenshot6-1536x782.png 1536w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2024\/02\/screenshot6-590x300.png 590w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2024\/02\/screenshot6.png 1633w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">Finally, click on Generate Token to generate a new token<\/p>\n\n\n\n<figure class=\"wp-block-gallery has-nested-images columns-default is-cropped wp-block-gallery-4 is-layout-flex wp-block-gallery-is-layout-flex\">\n<figure class=\"wp-block-image size-large\"><a href=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2024\/02\/screenshot7.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"300\" data-id=\"7738\" src=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2024\/02\/screenshot7-1024x300.png\" alt=\"\" class=\"wp-image-7738\" srcset=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2024\/02\/screenshot7-1024x300.png 1024w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2024\/02\/screenshot7-300x88.png 300w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2024\/02\/screenshot7-768x225.png 768w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2024\/02\/screenshot7-850x249.png 850w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2024\/02\/screenshot7.png 1047w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/a><\/figure>\n<\/figure>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Step 5:<\/strong><br>Your personal access token has been successfully created.<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><a href=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2024\/02\/screenshot8.png\"><img loading=\"lazy\" decoding=\"async\" width=\"1012\" height=\"217\" src=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2024\/02\/screenshot8.png\" alt=\"\" class=\"wp-image-7739\" srcset=\"https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2024\/02\/screenshot8.png 1012w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2024\/02\/screenshot8-300x64.png 300w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2024\/02\/screenshot8-768x165.png 768w, https:\/\/pheonixsolutions.com\/blog\/wp-content\/uploads\/2024\/02\/screenshot8-850x182.png 850w\" sizes=\"(max-width: 1012px) 100vw, 1012px\" \/><\/a><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Conclusion<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">GitHub personal access tokens provide a secure way to authenticate applications, automation tools, and Git operations without using an account password.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">When creating a token, always follow the <strong>principle of least privilege<\/strong> by granting only the permissions and repository access required for the intended task. Set an appropriate expiration date and store the token securely to prevent unauthorized access.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">FAQs<\/h2>\n\n\n\n<h3 class=\"wp-block-heading\">1. What is a GitHub personal access token?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">A personal access token is a credential that can be used to authenticate with GitHub APIs, Git operations, and supported applications instead of using a GitHub password.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">2. Which type of GitHub token should I use?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">GitHub provides <strong>fine-grained personal access tokens<\/strong> and <strong>classic personal access tokens<\/strong>. Fine-grained tokens provide more detailed control over repository access and permissions and are generally preferred for new use cases.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">3. Can I use a GitHub token for Jenkins?<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">Yes. A GitHub personal access token can be stored in Jenkins Credentials and used by Jenkins jobs that need to authenticate with GitHub.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Related Articles:<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/pheonixsolutions.com\/blog\/how-to-add-repository-secrets-in-github\/\">How to add repository secrets in GitHub &#8211; Pheonix Solutions<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/pheonixsolutions.com\/blog\/setup-aws-codedeploy-linux\/\">How to Set Up AWS CodeDeploy on Linux for GitHub Deployments &#8211; Pheonix Solutions<\/a><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Talk to our experts:<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Have a technology challenge or looking for the right solution for your business? Our team can help you with <strong>cloud, DevOps, development, infrastructure, design, and more<\/strong>. Feel free to reach out to our experts <a href=\"https:\/\/pheonixsolutions.com\/contact\">here<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Introduction: Personal access tokens (PATs) are an alternative to using passwords for authentication to GitHub when using the GitHub API [&hellip;]<\/p>\n","protected":false},"author":499,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"site-sidebar-layout":"default","site-content-layout":"","ast-site-content-layout":"default","site-content-style":"default","site-sidebar-style":"default","ast-global-header-display":"","ast-banner-title-visibility":"","ast-main-header-display":"","ast-hfb-above-header-display":"","ast-hfb-below-header-display":"","ast-hfb-mobile-header-display":"","site-post-title":"","ast-breadcrumbs-content":"","ast-featured-img":"","footer-sml-layout":"","ast-disable-related-posts":"","theme-transparent-header-meta":"","adv-header-id-meta":"","stick-header-meta":"","header-above-stick-meta":"","header-main-stick-meta":"","header-below-stick-meta":"","astra-migrate-meta-layouts":"default","ast-page-background-enabled":"default","ast-page-background-meta":{"desktop":{"background-color":"var(--ast-global-color-5)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"ast-content-background-meta":{"desktop":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"tablet":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""},"mobile":{"background-color":"var(--ast-global-color-4)","background-image":"","background-repeat":"repeat","background-position":"center center","background-size":"auto","background-attachment":"scroll","background-type":"","background-media":"","overlay-type":"","overlay-color":"","overlay-opacity":"","overlay-gradient":""}},"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[1020],"tags":[598],"class_list":["post-7730","post","type-post","status-publish","format-standard","hentry","category-containers-kubernetes","tag-github","psol-cat-containers-kubernetes"],"jetpack_publicize_connections":[],"jetpack_shortlink":"https:\/\/wp.me\/phn2x7-20G","jetpack_sharing_enabled":true,"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/7730","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/users\/499"}],"replies":[{"embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/comments?post=7730"}],"version-history":[{"count":3,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/7730\/revisions"}],"predecessor-version":[{"id":11780,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/posts\/7730\/revisions\/11780"}],"wp:attachment":[{"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/media?parent=7730"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/categories?post=7730"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/pheonixsolutions.com\/blog\/wp-json\/wp\/v2\/tags?post=7730"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}