Git:我的远程网址是什么?

时间:2017-01-24 21:37:20

标签: git

enter image description here

我有一个本地的git repo,我想把它推到一个新的服务器,我在'gitrepo'(截图)初始化了一个(非裸)repo。我当地有:

repo    ssh://deploy@198.xxx.xxx.xxx/gitrepo (fetch)
repo    ssh://deploy@198.xxx.xxx.xxx/gitrepo (push)

当我这样做时:

$ git push repo myproject
....
debug1: Authentication succeeded (password).
debug1: Requesting no-more-sessions@openssh.com
debug1: Entering interactive session.
debug1: client_input_global_request: rtype hostkeys-00@openssh.com want_reply 0
debug1: Sending command: git-receive-pack '/gitrepo'
debug1: client_input_channel_req: channel 0 rtype exit-status reply 0
debug1: client_input_channel_req: channel 0 rtype eow@openssh.com reply 0
fatal: '/gitrepo' does not appear to be a git repository
debug1: channel 0: free: client-session, nchannels 1
Transferred: sent 2836, received 2588 bytes, in 0.3 seconds
Bytes per second: sent 9421.9, received 8598.0
debug1: Exit status 128
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

我是否推错了网址?

2 个答案:

答案 0 :(得分:2)

它在根目录中查找/gitrepo。要使其相对于ssh的目标用户的主目录,请使用

ssh://deploy@198.xxx.xxx.xxx/~/gitrepo

答案 1 :(得分:1)

  

我是否推送错误的网址?

是。这是ssh debug gobbledygook中的重要一行。

fatal: '/gitrepo' does not appear to be a git repository

您已使用SSH成功​​登录,但您的网址错误。我无法说出正确的网址。你可能有错误的路径,你可能有错误的主机。路径最后可能需要一个.git。你应该问一下这个项目的人。