How to fix fatal: Could not read from remote repository. Check that Pageant is running. in Git
This error occurs when Git for Windows cannot communicate with Pageant, the PuTTY SSH authentication agent. The fix involves starting Pageant, loading your SSH keys, or switching to OpenSSH for authentication.
Quick fix
Fixes fatal: Could not read from remote repository. Check that Pageant is running.
Press Ctrl+Shift+Esc to open Task Manager
Look for "pageant.exe" in the list of processes- Check if Pageant is running
- Start Pageant and load your SSH key
- Configure Pageant to start automatically
- Switch from PuTTY/Pageant to OpenSSH
Press Ctrl+Shift+Esc to open Task ManagerLook for "pageant.exe" in the list of processesfatal: Could not read from remote repository. Check that Pageant is running.
What this error means
This error indicates that Git is configured to use PuTTY's Pageant as the SSH authentication agent, but Pageant is either not running or not accessible. Pageant is part of the PuTTY suite and manages SSH private keys for Windows applications. When you attempt to clone, push, pull, or fetch from a remote repository using SSH, Git needs to authenticate with the server. If Git is configured to use PuTTY tools (plink.exe) instead of OpenSSH, it looks for Pageant to provide the SSH keys. When Pageant isn't running or hasn't loaded your keys, Git cannot authenticate and displays this error. The "fatal: Could not read from remote repository" message confirms that Git was completely unable to access the repository because SSH authentication failed before any connection could be established.
Typical symptoms
- Git operations (clone, push, pull, fetch) fail with 'Check that Pageant is running'
- Error appears specifically on Windows systems
- Git was working but fails after a system restart
- Pageant icon is not visible in the system tray
- Error occurs even when Pageant appears to be running
- Git Bash works but Git in other terminals or IDEs fails
- Works in some applications but not others on the same machine
- CI/CD or automated scripts fail on Windows build agents
Common causes
- Pageant is not running in the system tray
- Pageant is running but no SSH keys are loaded
- Git is configured to use plink.exe but you want to use OpenSSH
- GIT_SSH environment variable points to plink.exe
- SSH keys were not added to Pageant after system restart
- Pageant key format (.ppk) doesn't match the key you're trying to use
- Running Git from a different user context than Pageant
- Pageant crashed or was closed accidentally
- SSH key passphrase wasn't entered when loading into Pageant
- Corporate security software blocking Pageant communication
How to fix "fatal: Could not read from remote repository. Check that Pageant is running."
First, verify whether Pageant is currently running:
1. Look in the system tray (bottom-right corner of Windows taskbar)
- Click the "^" arrow to show hidden icons
- Look for the Pageant icon (a computer with a hat)
2. Check via Task Manager:
Press Ctrl+Shift+Esc to open Task Manager
Look for "pageant.exe" in the list of processes3. Check from command line:
# PowerShell
Get-Process pageant -ErrorAction SilentlyContinue
# Or Command Prompt
tasklist | findstr pageantIf Pageant is not running, proceed to start it. If it is running but you still see the error, your keys may not be loaded.
Start Pageant and add your SSH private key:
Start Pageant:
1. Open the Start menu and search for "Pageant"
2. Or navigate to your PuTTY installation folder and double-click pageant.exe
3. Pageant will appear in your system tray
Load your SSH key:
1. Right-click the Pageant icon in the system tray
2. Select "Add Key"
3. Navigate to your private key file (.ppk format)
4. Enter your passphrase if prompted
5. Click "Open"
Verify the key is loaded:
1. Right-click the Pageant icon
2. Select "View Keys"
3. Your key should appear in the list
Alternative - Load key from command line:
"C:\Program Files\PuTTY\pageant.exe" "C:\Users\YourName\.ssh\your_key.ppk"Note: Pageant requires keys in PuTTY's .ppk format. If you have an OpenSSH key (like id_rsa or id_ed25519), you'll need to convert it first (see advanced notes).
To avoid this error after every restart, configure Pageant to start automatically with your keys:
Option 1: Add Pageant to Windows Startup
1. Press Win+R and type shell:startup
2. Create a shortcut to Pageant with your key as an argument
3. Right-click in the Startup folder > New > Shortcut
4. Enter the path:
"C:\Program Files\PuTTY\pageant.exe" "C:\Users\YourName\.ssh\your_key.ppk"5. Name the shortcut "Pageant" and click Finish
Option 2: Create a batch file:
@echo off
start "" "C:\Program Files\PuTTY\pageant.exe" "C:\Users\YourName\.ssh\your_key.ppk"Save as start-pageant.bat in your Startup folder.
Option 3: Use Task Scheduler
1. Open Task Scheduler
2. Create a new task to run at logon
3. Set the action to start Pageant with your key path
Note: If your key has a passphrase, you'll still be prompted to enter it when Pageant starts.
If you prefer to use Windows built-in OpenSSH instead of PuTTY tools, reconfigure Git:
Check current Git SSH configuration:
# Check GIT_SSH environment variable
echo %GIT_SSH%
# Or in PowerShell
$env:GIT_SSHIf this points to plink.exe, Git is using PuTTY.
Remove the GIT_SSH setting:
# Remove from current session
set GIT_SSH=
# Remove permanently (System Properties > Environment Variables)
# Or via PowerShell (run as Administrator)
[Environment]::SetEnvironmentVariable("GIT_SSH", $null, "User")Configure Git to use OpenSSH:
# Set Git to use Windows OpenSSH
git config --global core.sshCommand "C:/Windows/System32/OpenSSH/ssh.exe"
# Or for Git Bash's built-in SSH
git config --global core.sshCommand "ssh"Verify the change:
git config --global core.sshCommandAfter this change, Git will use OpenSSH instead of PuTTY, and you won't need Pageant.
If you switched to OpenSSH, set up SSH authentication:
Start the OpenSSH Authentication Agent:
# Check if service is running (run PowerShell as Administrator)
Get-Service ssh-agent
# Set to start automatically
Set-Service -Name ssh-agent -StartupType Automatic
# Start the service
Start-Service ssh-agentGenerate or use existing SSH keys:
# Generate a new key (if needed)
ssh-keygen -t ed25519 -C "your_email@example.com"
# Add your key to the agent
ssh-add ~/.ssh/id_ed25519Test the connection:
ssh -T git@github.comYou should see: "Hi username! You've successfully authenticated..."
If you have an existing PuTTY key (.ppk):
You'll need to convert it to OpenSSH format using PuTTYgen:
1. Open PuTTYgen
2. Click "Load" and select your .ppk file
3. Go to Conversions > Export OpenSSH key
4. Save as ~/.ssh/id_rsa or similar
5. Add to ssh-agent with ssh-add
Confirm Git is using the correct SSH method:
Check all SSH-related settings:
# Check core.sshCommand
git config --global core.sshCommand
# Check GIT_SSH environment variable
echo %GIT_SSH%
# List all SSH-related config
git config --list | findstr -i sshTest Git SSH access:
# Use GIT_TRACE for detailed debugging
set GIT_TRACE=1
git ls-remote git@github.com:username/repo.git
# Or with SSH debugging
set GIT_SSH_COMMAND=ssh -vvv
git ls-remote git@github.com:username/repo.gitExpected behavior:
- If using Pageant: Git should use plink.exe and require Pageant running
- If using OpenSSH: Git should use Windows ssh.exe and use ssh-agent
Verify which SSH is being used:
# In Git Bash
which ssh
# Should show:
# /usr/bin/ssh (Git Bash's OpenSSH)
# or
# /c/Windows/System32/OpenSSH/ssh (Windows OpenSSH)If Pageant is running with keys loaded but Git still can't connect:
Verify plink can reach Pageant:
# Test with plink directly
plink -v git@github.comLook for messages about Pageant in the output.
Check if running as different user:
Pageant only serves keys to processes running as the same Windows user. If you:
- Run Git as Administrator but Pageant as regular user
- Use a service account for builds
- Run in a different Remote Desktop session
The processes cannot share Pageant's keys.
Solutions:
1. Run Git in the same user context as Pageant
2. For services, use the Windows Credential Manager or deploy keys
3. For CI/CD, use OpenSSH with key files instead of Pageant
Antivirus/Security software interference:
Some security software blocks inter-process communication:
1. Temporarily disable antivirus
2. Check if Pageant is whitelisted
3. Look for blocked connections in security logs
Restart Pageant:
# Kill and restart Pageant
taskkill /F /IM pageant.exe
"C:\Program Files\PuTTY\pageant.exe" "C:\path\to\your\key.ppk"Advanced notes
### Converting OpenSSH Keys to PuTTY Format
If you have OpenSSH keys and need to use them with Pageant:
1. Open PuTTYgen
2. Click "Load"
3. Change file filter to "All Files (*.*)"
4. Select your private key (id_rsa, id_ed25519, etc.)
5. Enter passphrase if prompted
6. Click "Save private key"
7. Save as .ppk file### Converting PuTTY Keys to OpenSSH Format
1. Open PuTTYgen
2. Click "Load" and select your .ppk file
3. Go to Conversions > Export OpenSSH key
4. Save to ~/.ssh/ with appropriate name
5. Set permissions (in Git Bash):
chmod 600 ~/.ssh/id_rsa### Using Pageant with WSL
Pageant cannot directly serve keys to WSL (Windows Subsystem for Linux). Options:
Option 1: Use wsl-ssh-pageant
A bridge that allows WSL to use Pageant keys:
# In WSL, add to ~/.bashrc
export SSH_AUTH_SOCK=/mnt/c/Users/YourName/wsl-ssh-pageant/ssh-agent.sockOption 2: Use Windows OpenSSH from WSL
# Add to ~/.bashrc
export GIT_SSH="/mnt/c/Windows/System32/OpenSSH/ssh.exe"Option 3: Use native WSL SSH
Generate and manage keys entirely within WSL using standard Linux ssh-agent.
### Multiple PuTTY Key Management
For multiple keys or accounts:
# Load multiple keys at startup
pageant.exe key1.ppk key2.ppk key3.ppkOr use separate Pageant instances (not recommended) with different pipes.
### Git Configuration for Specific Repositories
You can configure SSH settings per-repository:
# For a specific repo, use OpenSSH
cd /path/to/repo
git config core.sshCommand "ssh"
# For another repo, use PuTTY
cd /path/to/other-repo
git config core.sshCommand "plink"### Debugging PuTTY/Plink Connections
# Maximum verbosity with plink
plink -v -v git@github.com
# Check Pageant is accessible
set PLINK_PROTOCOL=ssh
plink -agent -v git@github.com### Environment Variable Priority
Git checks for SSH configuration in this order:
1. GIT_SSH_COMMAND (highest priority)
2. core.sshCommand git config
3. GIT_SSH environment variable
4. Default SSH on PATH
### Corporate/Enterprise Considerations
In enterprise environments:
- IT may require PuTTY for compliance/logging
- Check with your IT department before switching to OpenSSH
- Some proxy configurations only work with PuTTY
- Pageant may be managed centrally via Group Policy
Frequently asked questions
- What does "fatal: Could not read from remote repository. Check that Pageant is ru" mean?
- This error indicates that Git is configured to use PuTTY's Pageant as the SSH authentication agent, but Pageant is either not running or not accessible. Pageant is part of the PuTTY suite and manages SSH private keys for Windows applications. When you attempt to clone, push, pull, or fetch from a remote repository using SSH, Git needs to authenticate with the server.
- How do I fix "fatal: Could not read from remote repository. Check that Pageant is ru"?
- This error occurs when Git for Windows cannot communicate with Pageant, the PuTTY SSH authentication agent. The fix involves starting Pageant, loading your SSH keys, or switching to OpenSSH for authentication.
- What causes "fatal: Could not read from remote repository. Check that Pageant is ru"?
- Pageant is not running in the system tray Pageant is running but no SSH keys are loaded Git is configured to use plink.exe but you want to use OpenSSH
- Is the "fatal: Could not read from remote repository. Check that Pageant is ru" error serious?
- It is a medium-severity error — more of a blocker than a risk. The steps above resolve it.
Official resources & further reading
- 📚Git Official Documentation
- 📖PuTTY Download Page - Official PuTTY and Pageant(Official Docs)
- 📖PuTTY Documentation - Using Pageant for authentication(Official Docs)
- 📖GitHub Docs - Connecting to GitHub with SSH(Official Docs)
- 📖Microsoft Docs - Install OpenSSH for Windows(Official Docs)
- 💬Stack Overflow - Git: Permission denied (publickey)(Stack Overflow)
- 💬Stack Overflow - How to use Git with PuTTY/Pageant on Windows(Stack Overflow)