Option A: Switch to SSH Keys (Recommended)
Switching your repository URL to SSH removes the need for passwords completely.
1. Check your current URL
git remote -v
If it starts with https://github.com/, proceed to the next steps.
2. Generate an SSH key (Press Enter to accept all default locations)
ssh-keygen -t ed25519 -C “your_email@example.com”
Skip if already exists.
3. Copy the generated key
cat ~/.ssh/id_ed25519.pub
Skip if #2 already exists.
4. Add it to GitHub
Navigate to the GitHub SSH Keys Settings page.
Click New SSH Key.
Paste your copied text and save.
Skip if already added.
5. Change your repository URL to SSH
git remote set-url origin git@github.com:USERNAME/REPOSITORY.git
(Replace USERNAME and REPOSITORY with your actual GitHub username and repository name).
Option B: Use a Personal Access Token (PAT)
Search for it, hahaha!