How to Create a Personal Access Token
This document explains how to create a Personal Access Token (PAT) on GitHub for Git Deployment with read-only access to the project repository.
This token is only used to pull source code, without permission to write or modify the repository.
When Is This Token Used?
- Git Deployment (auto pull)
- Private repository
- Secure access (read-only)
Creation Steps
1. Open GitHub Settings
- Log in to GitHub
- Click your profile photo in the top right
- Select Settings

2. Go to Developer Settings
Navigate to:
Settings → Developer settings → Personal access tokens → Fine-grained tokens
-
Developer Settings

-
Tokens

-
Fine-grained Tokens

3. Generate Token (Read-Only)
Click Generate new token, then set it up as follows:
-
Token name: for example
raznar-git-deploy -
Expiration: as needed
-
Repository access:
- Only select repositories
- Select the project repository
-
Permissions:
- Contents → Read-only
- Metadata → Read-only
⚠️ Do not enable any other permissions.

4. Generate & Save the Token
Click Generate token and copy the token.

IMPORTANT
The token only appears once. Store it safely.
Using the Token
Use the token when configuring the repository on the server.
Example repository URL:
https://<USERNAME>:<PERSONAL_ACCESS_TOKEN>@github.com/username/repository.git
Security Notes
- Use a read-only token
- Don't share the token, keep it safe
- If it leaks, revoke it immediately