I can no longer push or pull from the repository I git clone
via github in the Amazon EC2 instance.
As I am a beginner, I may not be able to do so, but I checked for about two days and made a try-and-error, but I would appreciate it if you could let me know without solving it.Thank you in advance.
ssh [email protected]
displays the following and the connection succeeds
Hi[username]!You've successfully authenticated, but GitHub does not
provide shell access.Connection to github.com closed.
ssh connection is configured.git remote-v
shows the following:
originssh:// [username]@g ithub.com/ [organization]/[repo].git(fetch)
origin ssh:// [username]@g ithub.com/ [organization]/[repo].git(push)
ssh [email protected]
displays the following and the connection succeeds
Hi[username]!You've successfully authenticated, but GitHub does not
provide shell access.Connection to github.com closed.
The ssh connection is configured. git remote-v
shows the following:
originssh:// [username]@g ithub.com/ [organization]/[repo].git(fetch)
origin ssh:// [username]@g ithub.com/ [organization]/[repo].git(push)
git push origin
, sudo git push origin
, git push [email protected]: [organization]/[repo].git
But all of the following are returned
Permission denied (publickey).
fatal —Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
git push origin
, sudo git push origin
, git push [email protected]: [organization]/[repo].git
But all of the following are returned
Permission denied (publickey).
fatal —Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
I was hitting the git command on sudo, which caused the user who registered with github to be different from the user who ran ssh.
ssh-T [email protected]
It was not sudo when running, so I went to access it with the same user who registered with github, and it seems that I went there.This was due to a lack of understanding of the basics of user switching when executing a command on sudo.
The URL configured as remote for git appears to have the wrong format.
git remote set-url origin [email protected]: organization/[repo].git
What happens if you do git pull?
© 2024 OneMinuteCode. All rights reserved.