😎

Can't push in git because we mistook ssh user ,

2021/10/09に公開

Issue

git push -u origin main

ERROR: Permission to yosidakouki/yoshida-consultation-office.git denied to deep-recommend-sugimoto.
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

Solution

create ssh-key by using user
 git config user.name <username>
 git config user.emain <useremail>
 git config --local user.name <username>
 git config --local user.emain <useremail>
 git config --global user.name <username>
 git config --global user.emain <useremail>
ssh -T git@github.com
eval `ssh-agent`
ssh-add ~/.ssh/<use rsa>

Discussion