代码之家  ›  专栏  ›  技术社区  ›  Blankman

当我ssh使用-i开关时,我还需要为我的git远程设备做这个吗?

  •  3
  • Blankman  · 技术社区  · 14 年前

    我在服务器上设置git,当我ssh进入服务器时,我会:

    ssh -i /path/to/key -p 30000 user@1.1.1.1
    

    现在,我在服务器上设置了git,然后像这样设置远程:

    remote add origin ssh://user@1.1.1.1:30000/path/to/git/repo/proj1
    

    我得到错误:

    推原点 没有共同的引用,也没有指定;什么都不做。 也许您应该指定一个分支,如“master”。 致命:远程端意外挂断 错误:未能将某些引用推送到“ssh://user@1.1.1.1:30000/path/to/git/repos/proj1”

    到目前为止,在我的本地回购中,我做到了:

    touch .gitignore
    git add .
    git commit -m 'init'
    

    我的服务器中有一个Git。

    更新

    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'
    

    我的SSH/CONFIG:

    Host git.myhost
            User myuser
            Hostname 1.2.3.4
            Port 30000
            IdentityFile /home/myuser/.ssh/key_for_git
    
    1 回复  |  直到 14 年前
        1
  •  4
  •   timdream    14 年前
    推荐文章