Yesterday I created a ssh key and cloned a repo for work. After making some changes I attempted to push a commit:
git push
ERROR: Repository not found.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
I have read this active SO post. My issue persists. I don't know how to track down the issue so will share everything that I think is relevant.
On my laptop I have both personal and work repos. My work work lives in any directory nested under ~/Documents/Projects/Zen/Projects/
. Anywhere else e.g. ~/Documents/Projects/Personal/
is for personal github.
My .gitconfig looks like this:
[user]
email = 12345+doug@users.noreply.github.com
name = 12345doug
[includeIf "gitdir:/home/doug/Documents/Projects/Zen/"]
path = ~/.git-zen
/.git-zen looks like this:
[user]
email = doug@work.com
name = doug-work
Currently I'm in a repo:
pwd
/home/doug/Documents/Projects/Zen/Projects/analytics-psql-action
With some commits ready to push:
~/Documents/Projects/Zen/Projects/analytics-psql-action$ git status
On branch master
Your branch is ahead of 'origin/master' by 2 commits.
(use "git push" to publish your local commits)
My git config in this dir seems correct:
git config user.name
doug-work
and
git config user.email
doug@work.com
To create my ssh keys I followed this post on github.com.
ssh-keygen -t rsa -b 4096 -C "doug@work.com"
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_rsa
I then added the key per this tutorial to my work github settings.
So far I think I have everything set up as it should? But when I try to push from within this repo:
~/Documents/Projects/Zen/Projects/analytics-psql-action$ git push
ERROR: Repository not found.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
In desperation I renamed the repo and attempted to clone from fresh:
git clone git@github.com:work/analytics-psql-action.git # real path actually used not 'work'
Cloning into 'analytics-psql-action'...
ERROR: Repository not found.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
On the repo itself, if I go into repo settings > manage access I can see myself, doug-work has admin access rights.
How can I clone and push to the repo? Where should I start in trying to find out why my set up of ssh keys are not working?