3.6 KiB
Git Authentication Fix for GitHub PRs
Problem
When pushing to GitHub, you get:
remote: Invalid username or token. Password authentication is not supported for Git operations.
fatal: Authentication failed
Solution Options
Option 1: Use SSH (Recommended)
If you have SSH keys set up:
-
Check if you have SSH keys:
ls -la ~/.ssh/id_*.pub -
If no SSH key exists, generate one:
ssh-keygen -t ed25519 -C "your_email@example.com" # Press Enter to accept default location # Optionally set a passphrase -
Add SSH key to GitHub:
cat ~/.ssh/id_ed25519.pub # Copy the output- Go to: https://github.com/settings/keys
- Click "New SSH key"
- Paste your public key
- Save
-
Update remote to use SSH:
cd /home/intlc/projects/proxmox/pr-workspace/chains git remote set-url origin git@github.com:defiQUG/chains.git -
Test SSH connection:
ssh -T git@github.com # Should say: "Hi defiQUG! You've successfully authenticated..." -
Push again:
git push origin update-chainid-138-rpc-endpoints
Option 2: Use Personal Access Token (PAT)
If you prefer HTTPS:
-
Create a Personal Access Token:
- Go to: https://github.com/settings/tokens
- Click "Generate new token" → "Generate new token (classic)"
- Name: "PR Workspace"
- Select scopes:
repo(full control of private repositories) - Click "Generate token"
- Copy the token immediately (you won't see it again!)
-
Update remote URL with token:
cd /home/intlc/projects/proxmox/pr-workspace/chains git remote set-url origin https://defiQUG:YOUR_TOKEN@github.com/defiQUG/chains.gitReplace
YOUR_TOKENwith your actual token. -
Push:
git push origin update-chainid-138-rpc-endpoints
Note: The token will be visible in git remote -v. For better security, use SSH or Git Credential Manager.
Option 3: Use Git Credential Manager (Most Secure for HTTPS)
-
Install Git Credential Manager (if not already installed):
# On Linux sudo apt-get install git-credential-manager # Or download from: https://github.com/GitCredentialManager/git-credential-manager -
Configure Git to use credential manager:
git config --global credential.helper manager -
Push (will prompt for credentials):
git push origin update-chainid-138-rpc-endpoints- Username:
defiQUG - Password: Your Personal Access Token (not your GitHub password)
- Username:
Quick Fix Script
Run this to switch to SSH (if you have SSH keys):
cd /home/intlc/projects/proxmox/pr-workspace/chains
git remote set-url origin git@github.com:defiQUG/chains.git
git push origin update-chainid-138-rpc-endpoints
Verify Authentication
After setting up authentication:
# Test SSH (if using SSH)
ssh -T git@github.com
# Or test with git (if using HTTPS)
git ls-remote origin
For All Three Repositories
If you need to fix authentication for all repos:
# Chains
cd /home/intlc/projects/proxmox/pr-workspace/chains
git remote set-url origin git@github.com:defiQUG/chains.git
# Cross-Chain-Mirroring
cd /home/intlc/projects/proxmox/pr-workspace/Cross-Chain-Mirroring
git remote set-url origin git@github.com:defiQUG/Cross-Chain-Mirroring.git
# app-ethereum
cd /home/intlc/projects/proxmox/pr-workspace/app-ethereum
git remote set-url origin git@github.com:defiQUG/app-ethereum.git
Last Updated: 2025-12-24 Status: Authentication guide ready