Gitlab拉推不起作用

时间:2014-02-26 12:14:23

标签: ruby git gitlab

OVERVIEW

我在ubuntu 13.10中本地使用Gitlab服务器,我在这些命令中得到了以下输出

sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production

System information
System:     Ubuntu 13.10
Current User:   git
Using RVM:  no
Ruby Version:   2.0.0p247
Gem Version:    2.0.3
Bundler Version:1.5.3
Rake Version:   10.1.0

GitLab information
Version:    6.0.2
Revision:   10b0b8f
Directory:  /home/git/gitlab
DB Adapter: mysql2
URL:        http://192.168.0.104
HTTP Clone URL: http://192.168.0.104/some-project.git
SSH Clone URL:  git@192.168.0.104:some-project.git
Using LDAP: no
Using Omniauth: no

GitLab Shell
Version:    1.7.0
Repositories:   /home/git/repositories/
Hooks:      /home/git/gitlab-shell/hooks/
Git:        /usr/bin/git
xxx@xxx:/home/git/gitlab$ cd /home/git/

现在我使用admin@local.host成功登录服务器并创建成员和项目。然后当我克隆到名为testgitlab的新项目时  按git clone http://192.168.0.104/sss/testgitlab.git 我可以克隆这个项目。

PROBLEM

1。当我尝试提交项目时,我可以做到这一点。在我尝试拉出项目git pull origin master时提交项目后,发生以下错误:

:~/Desktop/testgitlab$ git pull origin master
Username for 'http://192.168.0.104': sss
Password for 'http://sss@192.168.0.104': 
fatal: Couldn't find remote ref master
Unexpected end of command stream

2。拉动项目后,我试图推动项目:

    ~/Desktop/testgitlab$ git push origin master
Username for 'http://192.168.0.104': sss
Password for 'http://sss@192.168.0.104': 
Counting objects: 3, done.
Writing objects: 100% (3/3), 220 bytes | 0 bytes/s, done.
Total 3 (delta 0), reused 0 (delta 0)
remote: /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.5.3/lib/bundler/spec_set.rb:92:in `block in materialize': Could not find json-1.7.7 in any of the sources (Bundler::GemNotFound)
remote:     from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.5.3/lib/bundler/spec_set.rb:85:in `map!'
remote:     from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.5.3/lib/bundler/spec_set.rb:85:in `materialize'
remote:     from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.5.3/lib/bundler/definition.rb:133:in `specs'
remote:     from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.5.3/lib/bundler/definition.rb:178:in `specs_for'
remote:     from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.5.3/lib/bundler/definition.rb:167:in `requested_specs'
remote:     from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.5.3/lib/bundler/environment.rb:18:in `requested_specs'
remote:     from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.5.3/lib/bundler/runtime.rb:13:in `setup'
remote:     from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.5.3/lib/bundler.rb:119:in `setup'
remote:     from /usr/local/lib/ruby/gems/2.0.0/gems/bundler-1.5.3/lib/bundler/setup.rb:17:in `<top (required)>'
remote:     from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
remote:     from /usr/lib/ruby/1.9.1/rubygems/custom_require.rb:36:in `require'
remote: error: hook declined to update refs/heads/master
To http://192.168.0.104/username/testgitlab.git
 ! [remote rejected] master -> master (hook declined)
error: failed to push some refs to 'http://192.168.0.104/sss/testgitlab.git'

检查gitlab状态时

    sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production
Checking Environment ...

Git configured for git user? ... yes
Has python2? ... yes
python2 is supported version? ... yes

Checking Environment ... Finished

Checking GitLab Shell ...

GitLab Shell version >= 1.7.0 ? ... OK (1.7.0)
Repo base directory exists? ... yes
Repo base directory is a symlink? ... no
Repo base owned by git:git? ... yes
Repo base access is drwxrws---? ... yes
post-receive hook up-to-date? ... yes
post-receive hooks in repos are links: ... 
Administrator / sesh ... repository is empty
sss / TestGitlab ... repository is empty

Checking GitLab Shell ... Finished

Checking Sidekiq ...

Running? ... yes

Checking Sidekiq ... Finished

Checking GitLab ...

Database config exists? ... yes
Database is SQLite ... no
All migrations up? ... yes
GitLab config exists? ... yes
GitLab config outdated? ... no
Log directory writable? ... yes
Tmp directory writable? ... yes
Init script exists? ... yes
Init script up-to-date? ... yes
Projects have satellites? ... 
Administrator / sesh ... can't create, repository is empty
sss / TestGitlab ... can't create, repository is empty
Redis version >= 2.0.0? ... yes
Your git bin path is "/usr/bin/git"
Git version >= 1.7.10 ? ... yes (1.8.3)

Checking GitLab ... Finished

我无法弄清楚我错过了什么...... 帮帮我 。 谢谢你的推荐!

2 个答案:

答案 0 :(得分:1)

我遇到了与@Jonathan所指的问题3384有关的问题。

我解决了它,允许git用户登录(修改/etc/passwd以将shell设置为git用户的bash)。
请在此处查看我的回答:GitLab 7-0 stable not able to push or clone

答案 1 :(得分:0)

github上的一个问题表明,它可能与unicorn / nginx / gitlab-shell配置有关。确保仔细检查所有配置:

https://github.com/gitlabhq/gitlabhq/issues/3384