DEV Community

Cover image for Fixing Git 'Repository Not Found' & Multiple SSH Key Issues
Tahsin Abrar
Tahsin Abrar

Posted on

Fixing Git 'Repository Not Found' & Multiple SSH Key Issues

If you’ve ever worked with multiple GitHub accounts and suddenly hit errors like:

  • Repository not found
  • Can’t clone or push to a private repo
  • Git showing a weird name like "Pagol98" in commits

…you’re not alone. This is one of those problems that looks confusing at first, but once you understand it, it becomes super easy to fix.

In this post, I’ll walk you through the exact issues, why they happen, and a clean, real-world solution you can reuse in any project.


The Real Problem (What’s Going Wrong?)

Let’s break it down into 3 common issues that often get mixed together:

1. Repository Not Found

git clone https://github.com/username/tailadmin-blade-dashboard.git
Enter fullscreen mode Exit fullscreen mode

Error:

remote: Repository not found.
fatal: repository not found
Enter fullscreen mode Exit fullscreen mode

👉 This usually means:

  • The repo name is wrong (typo)
  • The repo is private and you don’t have access
  • You’re using the wrong account

2. Multiple SSH Keys Confusion

You created:

  • id_ed25519 (personal)
  • id_work (work)

👉 But Git doesn’t know which key to use for which repo.

So sometimes:

  • One repo works ✅
  • Another repo fails ❌

3. 😅 Random Commit Name (like “Pagol98”)

Git uses:

  • user.name
  • user.email

If not set correctly → it uses old/default values.


Real-Life Scenario (Why This Happens)

Let’s say:

  • You have 2 GitHub accounts → Personal + Work
  • Both have different SSH keys
  • You clone using HTTPS or default SSH

👉 Git gets confused:

“Which identity should I use?”

And that’s where things break.


Step-by-Step Fix (Clean & Professional Setup)

Step 1: Create SSH Config File

Path:

C:\Users\Asus\.ssh\config
Enter fullscreen mode Exit fullscreen mode

If not exists → create it.

Now add this:

# Personal GitHub
Host github-personal
    HostName github.com
    User git
    IdentityFile ~/.ssh/id_ed25519

# Work GitHub
Host github-work
    HostName github.com
    User git
    IdentityFile ~/.ssh/id_work
Enter fullscreen mode Exit fullscreen mode

👉 This is the magic step.


Step 2: Use SSH Instead of HTTPS

❌ Don’t use:

https://github.com/username/repo.git
Enter fullscreen mode Exit fullscreen mode

✅ Use SSH:

git@github.com:username/repo.git
Enter fullscreen mode Exit fullscreen mode

Now modify it using your config:

👉 Personal repo:

git clone git@github-personal:username/repo.git
Enter fullscreen mode Exit fullscreen mode

👉 Work repo:

git clone git@github-work:username/repo.git
Enter fullscreen mode Exit fullscreen mode

Step 3: Test SSH Connection

ssh -T git@github-personal
ssh -T git@github-work
Enter fullscreen mode Exit fullscreen mode

✅ Expected:

Hi username! You've successfully authenticated
Enter fullscreen mode Exit fullscreen mode

Step 4: Fix Git Commit Name

Check current config:

git config --global user.name
git config --global user.email
Enter fullscreen mode Exit fullscreen mode

Set correct values:

git config --global user.name "Your Name"
git config --global user.email "your-email@gmail.com"
Enter fullscreen mode Exit fullscreen mode

Per-Repository Config (Best Practice)

If you use multiple accounts, don’t rely only on global config.

Inside a specific repo:

git config user.name "Work Name"
git config user.email "work-email@gmail.com"
Enter fullscreen mode Exit fullscreen mode

👉 This avoids mixing identities.


Step 5: Verify Remote URL

git remote -v
Enter fullscreen mode Exit fullscreen mode

Make sure it shows:

git@github-work:username/repo.git
Enter fullscreen mode Exit fullscreen mode

or

git@github-personal:username/repo.git
Enter fullscreen mode Exit fullscreen mode

This is one of those issues every developer faces at some point—especially when juggling personal and work GitHub accounts.

The key takeaway is simple:

Git doesn’t “understand accounts” — it only understands configuration.

Once you properly configure:

  • SSH keys
  • SSH config
  • Git user info

👉 Everything becomes predictable and smooth.

Top comments (0)