Based on the error message Could not resolve hostname github.com:alexandranes/demo-repo.git it appears that the entire URL is used as hostname, which then cannot be resolved. As seen in this example, only the part before the colon should appear in the error message.
% git clone test.invalid:foo/bar.git
Cloning into 'bar'...
ssh: Could not resolve hostname test.invalid: nodename nor servname provided, or not known
fatal: Could not read from remote repository.
Is it possible that the : is a lookalike character? Try and copy the SSH URL from the GitHub repository page (under the green Code button) just to be sure.
Here are some additional things to try:
Check remotes
You mentioned that you cannot push, which indicates that the repository is already cloned. Execute the command git remote -v to check if the remote URLs are set correctly. The result should look like this
origin [email protected]:alexandranes/demo-repo.git (fetch)
origin [email protected]:alexandranes/demo-repo.git (push)
If the result looks different, you can set the correct URL with
git remote set-url origin [email protected]:alexandranes/demo-repo.git
Try cloning again
If you haven's cloned the repository yet, or just to test again with a fresh one, you can try and clone it again somewhere else (e.g. ~/Downloads or /tmp).
To be sure, try and use the macOS Terminal instead of the Eclipse terminal.
git clone [email protected]:alexandranes/demo-repo.git
ssh -T [email protected]provided in the other answer give the same error?