VOOZH about

URL: https://dev.to/tahsin000/fixing-git-repository-not-found-multiple-ssh-key-issues-14de

⇱ Fixing Git 'Repository Not Found' & Multiple SSH Key Issues - DEV Community


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

Error:

remote: Repository not found.
fatal: repository not found

👉 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

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

👉 This is the magic step.


Step 2: Use SSH Instead of HTTPS

❌ Don’t use:

https://github.com/username/repo.git

✅ Use SSH:

git@github.com:username/repo.git

Now modify it using your config:

👉 Personal repo:

git clone git@github-personal:username/repo.git

👉 Work repo:

git clone git@github-work:username/repo.git

Step 3: Test SSH Connection

ssh -T git@github-personal
ssh -T git@github-work

✅ Expected:

Hi username! You've successfully authenticated

Step 4: Fix Git Commit Name

Check current config:

git config --global user.name
git config --global user.email

Set correct values:

git config --global user.name "Your Name"
git config --global user.email "your-email@gmail.com"

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"

👉 This avoids mixing identities.


Step 5: Verify Remote URL

git remote -v

Make sure it shows:

git@github-work:username/repo.git

or

git@github-personal:username/repo.git

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.