【发布时间】:2014-03-27 00:52:34
【问题描述】:
我无法将我的代码从 git 推送到 gerrit。首先我检查了这样的代码:
git clone ssh://user@location.com:22/path/to/code
然后我尝试像这样设置一个推送网址:
git remote set-url --push origin "someotherlocation.com:/path/to/code HEAD:refs/for/master"
当我执行git push 时,它会返回此错误:
fatal: '/path/to/code HEAD:refs/for/master': not a Gerrit project
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
但是,如果我只是输入
git push someotherlocation.com:/path/to/code HEAD:refs/for/master
它被推送到 gerrit 服务器。为什么会这样,我做错了什么?谢谢!
【问题讨论】:
-
什么是URI方案?是
ssh://吗?将其包含在 URI 中是否有帮助? -
没有URI方案,只有
git push someotherlocation.com:/path/to/code HEAD:refs/for/master。当我输入 ssh:// 时,它给了我一个错误,上面写着: ssh: 无法解析主机名 someotherlocation.com:: 节点名或提供的服务名,或未知致命:无法从远程存储库读取。请确保您具有正确的访问权限并且存储库存在。 -
我也试过用 ssh:// 添加用户名和端口号,但还是不喜欢。