上下文/信息
我在Ubuntu12.04上安装了gitlab,详情见官方页面:https://github.com/gitlabhq/gitlabhq/blob/stable/doc/installation.md
安装后,我可以使用以下凭据访问http://machine_ip:3000的web界面:
admin@local.host
5iveL!fe
在我的机器上,我有以下用户:- git (在本教程中没有设置密码)- gitlab (在本教程中设置为自动)- my_username (由我作为根用户使用的普通用户)
在gitlab的web界面中,当被请求时,我在my_username上生成了一个公共rsa密钥并将其粘贴到那里。
然后,我使用git init和git remote add origin在/home/my_username/test中创建了一个存储库,如本教程所示。当我试图推送我的提交时,我得到了以下错误:
To git@localhost:test.git
! [rejected] master -> master (non-fast-forward)
error: failed to push some refs to 'git@localhost:test.git'
To prevent you from losing history, non-fast-forward updates were rejected
Merge the remote changes (e.g. 'git pull') before pushing again. See the
'Note about fast-forwards' section of 'git push --help' for details.我告诉你所有这些是为了更好地理解我试图实现的目标以及我收到的错误消息。
问题所在
在开发人员的机器上,我安装了putty、pageant、puttygen和msysgit。我在gitlab的界面中生成了一个与新用户关联的密钥。此外,我将GIT_SSH设置为使用plink,以便让msysgit使用pageant (它是连接的密钥)。
我不需要密码就可以连接到git@machine_ip,所以密钥被添加到git中的authorized_keys中。
但是,当我尝试克隆源位置为git@machine_ip:test.git的存储库时,我得到了以下错误消息:
fatal: 'test.git' does not appear to be a git repository
fatal: The remote end hung up unexpectedly我不知道我搞错了什么。我是否应该做一些不同的事情(创建一个新项目,以不同的方式设置存储库,在gitlab中添加新用户和他们的密钥)等等。
你能提供一些帮助吗?
更新信息
我通过使用交钥匙gitlab设备重新安装机器,然后升级(我承认有点匆忙) gitlab解决了这个问题。
谢谢大家。
发布于 2012-10-05 16:22:39
我将首先通过GitLab接口本身声明存储库测试,然后克隆该存储库。
(而不是在本地初始化repo,然后尝试推送它)
正如OP rsavu提到的,使用turnkey GitLab appliance和升级GitLab就足以解决这个问题。
https://stackoverflow.com/questions/12742023
复制相似问题