I have a git repository (version 2.1.2 ) with remote ssh :
$ git remote -v origin ssh:// dettorer@dettorer.net :/home/dettorer/my_project (fetch) origin ssh:// dettorer@dettorer.net :/home/dettorer/my_project (push)
What can not be pressed:
$ git push Bad port '' fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.
If ... I use the --verbose switch:
$ git push --verbose Pushing to ssh:// dettorer@dettorer.net :/home/dettorer/my_project Enter passphrase for key '/home/dettorer/.ssh/id_rsa': Counting objects: 7, done. ... To ssh:// dettorer@dettorer.net :/home/dettorer/my_project e633fe9..5d2e9de master -> master updating local tracking ref 'refs/remotes/origin/master'
In this answer, I added the ssh log level, designated as, but the output for git push (without --verbose ) was the same.
Where could this come from?
As nwinkler suggested, here is the output of two commands with GIT_TRACE=2 :
$ GIT_TRACE=2 git push 13:42:33.002392 git.c:349 trace: built-in: git 'push' 13:42:33.033594 run-command.c:341 trace: run_command: 'ssh' '-p' '' ' dettorer@dettorer.net ' 'git-receive-pack '\''/home/dettorer/my_project'\''' Bad port '' fatal: Could not read from remote repository. Please make sure you have the correct access rights $ GIT_TRACE=2 git push -v 13:42:39.929236 git.c:349 trace: built-in: git 'push' '-v' Pushing to ssh:// dettorer@dettorer.net :/home/dettorer/my_project 13:42:39.944837 run-command.c:341 trace: run_command: 'ssh' ' dettorer@dettorer.net ' 'git-receive-pack '\''/home/dettorer/my_project'\''' Enter passphrase for key '/home/dettorer/.ssh/id_rsa':
Therefore, if I do not use --verbose , there is actually an additional option '-p' with an empty argument.
EDIT: this is becoming more obscure:
$ git push origin Bad port '' fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. $ git remote add test test $ git push origin Enter passphrase for key '/home/dettorer/.ssh/id_rsa': $ git remote remove test $ git push origin Bad port '' fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.
source share