On GitHub.com, open Create a personal access token (classic). For GitHub Enterprise Server, sign in to the server that hosts your repository and go to Developer settings > Personal access tokens > Tokens (classic) in your account settings, and choose Generate new token (classic).
Select only the scopes needed for the task.
repo: Used to access private repositories with a classic token. It includes write access as well as read access, so handle the token carefully.read:org: Select this when organization and team membership must be read.project,write:org: These allow changes to projects or organizations. Do not add them as default permissions merely to read repository source code.
Check which token types your installation and organization allow. Enter a descriptive name in Note and set an expiration date. Select Generate token and store the token securely.