# 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:** 1. **Check if you have SSH keys**: ```bash ls -la ~/.ssh/id_*.pub ``` 2. **If no SSH key exists, generate one**: ```bash ssh-keygen -t ed25519 -C "your_email@example.com" # Press Enter to accept default location # Optionally set a passphrase ``` 3. **Add SSH key to GitHub**: ```bash cat ~/.ssh/id_ed25519.pub # Copy the output ``` - Go to: https://github.com/settings/keys - Click "New SSH key" - Paste your public key - Save 4. **Update remote to use SSH**: ```bash cd /home/intlc/projects/proxmox/pr-workspace/chains git remote set-url origin git@github.com:defiQUG/chains.git ``` 5. **Test SSH connection**: ```bash ssh -T git@github.com # Should say: "Hi defiQUG! You've successfully authenticated..." ``` 6. **Push again**: ```bash git push origin update-chainid-138-rpc-endpoints ``` --- ### Option 2: Use Personal Access Token (PAT) **If you prefer HTTPS:** 1. **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!) 2. **Update remote URL with token**: ```bash cd /home/intlc/projects/proxmox/pr-workspace/chains git remote set-url origin https://defiQUG:YOUR_TOKEN@github.com/defiQUG/chains.git ``` Replace `YOUR_TOKEN` with your actual token. 3. **Push**: ```bash 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) 1. **Install Git Credential Manager** (if not already installed): ```bash # On Linux sudo apt-get install git-credential-manager # Or download from: https://github.com/GitCredentialManager/git-credential-manager ``` 2. **Configure Git to use credential manager**: ```bash git config --global credential.helper manager ``` 3. **Push (will prompt for credentials)**: ```bash git push origin update-chainid-138-rpc-endpoints ``` - Username: `defiQUG` - Password: Your Personal Access Token (not your GitHub password) --- ## Quick Fix Script Run this to switch to SSH (if you have SSH keys): ```bash 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: ```bash # 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: ```bash # 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