I'm using the (relatively) new Git sshCommand:
git config core.sshCommand 'ssh -i ~/Documents/keydir/key.pem'
This results in the following config:
sshCommand = ssh -i ~/Documents/keydir/key.pem
But when I try to push to the server (btw I'm using the home directory. Does it have to be the www directory?)
[remote "origin"]
url = ssh://ubuntu@myserver.com:22/home/ubuntu/myrepo.git
or
[remote "origin"]
url = ssh://ubuntu@myserver.com/home/ubuntu/myrepo.git
It returns the:
git push remote master
fatal: 'remote' does not appear to be a git repository
fatal: Could not read from remote repository.
...error.
Haven't been able to figure it out.
I've tried using "~/myrepo.git" and "/home/ubuntu/myrepo.git" and I've also tried "url = ssh://ubuntu@myserver.com:/home/ubuntu/myrepo.git"
I've also tried starting a new git in the /var/www folder...
Nothing seems to work. And the myrepo.git is definitely there in the ubuntu home folder.
Any ideas?
EDIT: My complete .git/config file:
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
ignorecase = true
precomposeunicode = true
sshCommand = ssh -i ~/Documents/keydir/key.pem
[remote "origin"]
url = ssh://ubuntu@myserver.com:22/home/ubuntu/mygit.git
fetch = +refs/heads/*:refs/remotes/origin/*
EDIT: Updating both local (2.5.4) and remote (2.7.4) versions of Git to the latest version (2.16.1) solved the problem.