I am setting up GIT on my server, when I SSH into my server I do:
ssh -i /path/to/key -p 30000 user@1.1.1.1
Now I setup GIT on the server, and I setup REMOTE like this:
remote add origin ssh://user@1.1.1.1:30000/path/to/git/repo/proj1
I’m getting the error:
push origin
No refs in common and none specified; doing nothing.
Perhaps you should specify a branch such as ‘master’.
fatal: The remote end hung up unexpectedly
error: failed to push some refs to ‘ssh://user@1.1.1.1:30000/path/to/git/repos/proj1’
So far in my local repo I did:
touch .gitignore
git add .
git commit -m 'init'
And my server has a git bare in it.
UPDATE
git push origin
git push origin
No refs in common and none specified; doing nothing.
Perhaps you should specify a branch such as 'master'.
fatal: The remote end hung up unexpectedly
error: failed to push some refs to 'ssh://git.myhost/home/myuser/gitrepos/csf'
My .ssh/config:
Host git.myhost
User myuser
Hostname 1.2.3.4
Port 30000
IdentityFile /home/myuser/.ssh/key_for_git
How about set up your host information in
.ssh/configfile;in this way you won’t need the
-iin bothsshandgit.Edit: little Googling I find this
https://git.wiki.kernel.org/index.php/GitTips#How_to_pass_ssh_options_in_git.3F
So the only solution other than
.ssh/configis to use$GIT_SSHenvironment variable.