banana@banana-pc:~/Projects/bananaproject$ git remote add origin https://github.com/bananauser/bananaprojectmanager.git
error: remote origin already exists.
banana@banana-pc:~/Projects/bananaproject$ git push -u origin main
Username for 'https://github.com': ^C
banana@banana-pc:~/Projects/bananaproject$ ssh -T git@github.com
Hi bananauser! You've successfully authenticated, but GitHub does not provide shell access.
banana@banana-pc:~/Projects/bananaproject$
How can I be authenticated and not being able to push?
ssh -T git@github.com
Note that on ssh -T git@github.com
it also gives me correct github account name which is totally dissimilar to everything I have named on my pc.
JC.
It asked you to supply your username for https://github.com
when pushing, so your remote was set to use HTTPS, https://github.com/bananauser/bananaprojectmanager.git
, rather than what would be the SSH remote for that repository, git@github.com:bananauser/bananaprojectmanager.git
.
It would have been possible to fix with;
git remote set-url origin git@github.com:bananauser/bananaprojectmanager.git
While the remote (see git remote -v
to check it) was set to HTTPS, your SSH authentication wouldn't have mattered. Worth noting as well that verifying SSH authentication in that manner just verifies that the first successful try for a key that is set to be attempted for that host is an authenticated key for some user, not necessarily the owner of a repository, a detail which is important to keep in mind if you have multiple accounts and you're trying to verify a specific one, you need to make sure the key for that account it the first key it will attempt for github.com
.