`

gitlab push ! [remote rejected] master -> master (pre-receive hook declined)

    博客分类:
  • git
 
阅读更多

这个问题我找到了自己的解决方法:

gitlab-shell 用 master 分支时 gitlab-shell/hooks/ 目录下 没有 update 文件,用以下命令:

# cd /home/git/gitlab-shell/

# git branch v1.9.8
 

这样gitlab-shell/hooks/ 目录下就有了 update 文件,再执行 push 就可以成功了。

 

gao@gao-VirtualBox:/var/www/html5$ git push -u origin masterUsername for 'http://gitlab.gxlhost.com': admin@example.com
Password for 'http://admin@example.com@gitlab.gxlhost.com':
对象计数中: 3, 完成.
写入对象中: 100% (3/3), 238 bytes | 0 bytes/s, 完成.
Total 3 (delta 0), reused 0 (delta 0)
remote: GitLab: You are not allowed to access some of the refs!
To http://gitlab.gxlhost.com/root/html5.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: 无法推送一些引用到 'http://gitlab.gxlhost.com/root/html5.git'

 

 

gao@gao-VirtualBox:/var/www/html5$ git push -u origin -f master
Username for 'http://gitlab.gxlhost.com': admin@example.com
Password for 'http://admin@example.com@gitlab.gxlhost.com':
对象计数中: 3, 完成.
写入对象中: 100% (3/3), 238 bytes | 0 bytes/s, 完成.
Total 3 (delta 0), reused 0 (delta 0)
error: RPC failed; result=18, HTTP code = 200
fatal: The remote end hung up unexpectedly
fatal: The remote end hung up unexpectedly
Everything up-to-date

 

 

gao@gao-VirtualBox:/var/www/hotel$ git remote add origin https://gitlab.gxl.com/root/hotel.git
gao@gao-VirtualBox:/var/www/hotel$ git push -u origin master
fatal: unable to access 'https://gitlab.gxl.com/root/hotel.git/': Couldn't resolve host 'gitlab.gxl.com'
gao@gao-VirtualBox:/var/www/hotel$ git push -u origin master
fatal: unable to access 'https://gitlab.gxl.com/root/hotel.git/': server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none

 

 

gao@gao-VirtualBox:~$ cd /home/git/gitlab
gao@gao-VirtualBox:/home/git/gitlab$ sudo bundle exec rake gitlab:check RAILS_ENV=production
 Warning
  You are running as user root, we hope you know what you are doing.
  Things may work/fail for the wrong reasons.
  For correct results you should run this as user git.

Checking Environment ...

Git configured for git user? ... no
  Try fixing it:
  sudo -u git -H git config --global user.name  "GitLab"
  sudo -u git -H git config --global user.email "gitlab@gxlhost.com"
  For more information see:
  doc/install/installation.md in section "GitLab"
  Please fix the error above and rerun the checks.

Checking Environment ... Finished

Checking GitLab Shell ...

GitLab Shell version >= 1.9.6 ? ... OK (2.0.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
Satellites access is drwxr-x---? ... yes
update hook up-to-date? ... no
Could not find /home/git/gitlab-shell/hooks/update
  Try fixing it:
  Check the hooks_path in config/gitlab.yml
  Check your gitlab-shell installation
  For more information see:
  doc/install/installation.md in section "GitLab Shell"
update hooks in repos are links: ... can't check because of previous errors
Running /home/git/gitlab-shell/bin/check
Check GitLab API access: OK
Check directories and files:
    /home/git/repositories: OK
    /home/git/.ssh/authorized_keys: OK
Test redis-cli executable: FAILED
gitlab-shell self-check failed
  Try fixing it:
  Make sure GitLab is running;
  Check the gitlab-shell configuration file:
  sudo -u git -H editor /home/git/gitlab-shell/config.yml
  Please fix the error above and rerun the checks.

Checking GitLab Shell ... Finished

Checking Sidekiq ...

Running? ... no
  Try fixing it:
  sudo -u git -H RAILS_ENV=production bin/background_jobs start
  For more information see:
  doc/install/installation.md in section "Install Init Script"
  see log/sidekiq.log for possible errors
  Please fix the error above and rerun the checks.

Checking Sidekiq ... Finished

Checking LDAP ...

LDAP is disabled in config/gitlab.yml

Checking LDAP ... Finished

Checking GitLab ...

Database config exists? ... yes
Database is SQLite ... no
All migrations up? ... yes
Database contains orphaned UsersGroups? ... no
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 namespace: ...
Administrator / html5 ... yes
Projects have satellites? ...
Administrator / html5 ... 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 (2.1.0)

Checking GitLab ... Finished

gao@gao-VirtualBox:/home/git/gitlab$

 

gao@gao-VirtualBox:~$ ps aux | grep gitlab
git       1829  0.0  3.3 158308 39860 ?        Sl   08:55   0:05 unicorn_rails master -D -c /home/git/gitlab/config/unicorn.rb -E production                                           
git       1871  0.0  8.0 161496 97344 ?        Sl   08:56   0:02 unicorn_rails worker[0] -D -c /home/git/gitlab/config/unicorn.rb -E production                                        
git       1874  0.0  8.1 162176 98016 ?        Sl   08:56   0:02 unicorn_rails worker[1] -D -c /home/git/gitlab/config/unicorn.rb -E production                                        
git       1899  0.1  9.3 244732 113060 ?       Sl   08:56   0:13 sidekiq 2.17.0 gitlab [0 of 25 busy]                                                                                                                                                                                                                     
gao       3949  0.0  0.0   5836   824 pts/5    S+   11:14   0:00 grep --color=auto gitlab
gao@gao-VirtualBox:~$

 

gao@gao-VirtualBox:/home/git/gitlab$ sudo -u git -H bundle exec rake gitlab:env:info RAILS_ENV=production

System information
System:        Ubuntu 12.04
Current User:    git
Using RVM:    no
Ruby Version:    2.1.2p95
Gem Version:    2.4.1
Bundler Version:1.7.3
Rake Version:    10.3.2
Sidekiq Version:2.17.0

GitLab information
Version:    7.1.1
Revision:    facfec4
Directory:    /home/git/gitlab
DB Adapter:    mysql2
URL:        http://gitlab.gxlhost.com
HTTP Clone URL:    http://gitlab.gxlhost.com/some-project.git
SSH Clone URL:    git@gitlab.gxlhost.com:some-project.git
Using LDAP:    no
Using Omniauth:    no

GitLab Shell
Version:    2.0.0.pre
Repositories:    /home/git/repositories/
Hooks:        /home/git/gitlab-shell/hooks/
Git:        /usr/bin/git
gao@gao-VirtualBox:/home/git/gitlab$

 

 

gao@gao-VirtualBox:/home/git/gitlab$ sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production
Checking Environment ...

Git configured for git user? ... yes

Checking Environment ... Finished

Checking GitLab Shell ...

GitLab Shell version >= 1.9.6 ? ... OK (2.0.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
Satellites access is drwxr-x---? ... yes
update hook up-to-date? ... no
Could not find /home/git/gitlab-shell/hooks/update
  Try fixing it:
  Check the hooks_path in config/gitlab.yml
  Check your gitlab-shell installation
  For more information see:
  doc/install/installation.md in section "GitLab Shell"
update hooks in repos are links: ... can't check because of previous errors
Running /home/git/gitlab-shell/bin/check
Check GitLab API access: OK
Check directories and files:
    /home/git/repositories: OK
    /home/git/.ssh/authorized_keys: OK
Test redis-cli executable: FAILED
gitlab-shell self-check failed
  Try fixing it:
  Make sure GitLab is running;
  Check the gitlab-shell configuration file:
  sudo -u git -H editor /home/git/gitlab-shell/config.yml
  Please fix the error above and rerun the checks.

Checking GitLab Shell ... Finished

Checking Sidekiq ...

Running? ... yes
Number of Sidekiq processes ... 1

Checking Sidekiq ... Finished

Checking LDAP ...

LDAP is disabled in config/gitlab.yml

Checking LDAP ... Finished

Checking GitLab ...

Database config exists? ... yes
Database is SQLite ... no
All migrations up? ... yes
Database contains orphaned UsersGroups? ... no
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 namespace: ...
Administrator / html5 ... yes
Projects have satellites? ...
Administrator / html5 ... 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 (2.1.0)

Checking GitLab ... Finished
----------------------

执行了

gao@gao-VirtualBox:/home/git/gitlab$ sudo -u git -H bundle exec rake gitlab:shell:install[v2.0.0] REDIS_URL=redis://localhost:6379 RAILS_ENV=production
[sudo] password for gao:
git fetch origin && git reset --hard $(git describe v2.0.0 || git describe origin/v2.0.0)
remote: Counting objects: 111, done.
remote: Compressing objects: 100% (67/67), done.
remote: Total 111 (delta 57), reused 79 (delta 41)
接收对象中: 100% (111/111), 24.31 KiB | 0 bytes/s, 完成.
处理 delta 中: 100% (57/57), 完成.
来自 https://github.com/gitlabhq/gitlab-shell
   3f36541..e49cb2b  master     -> origin/master
 * [新分支]          version-1-9 -> origin/version-1-9
 * [新tag]           v1.9.8     -> v1.9.8
 * [新tag]           v2.0.0     -> v2.0.0
 * [新tag]           v2.0.1     -> v2.0.1
HEAD 现在位于 67eb0c4 Version 2.0.0
bin/install
mkdir -p /home/git/repositories/: OK
mkdir -p /home/git/.ssh: OK
chmod 700 /home/git/.ssh: OK
touch /home/git/.ssh/authorized_keys: OK
chmod 600 /home/git/.ssh/authorized_keys: OK
chmod -R ug+rwX,o-rwx /home/git/repositories/: OK
find /home/git/repositories/ -type d -exec chmod g+s {} ;: OK
gao@gao-VirtualBox:/home/git/gitlab$

---------------------

获得如下:

gao@gao-VirtualBox:/home/git/gitlab$ sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production
[sudo] password for gao:
Checking Environment ...

Git configured for git user? ... yes

Checking Environment ... Finished

Checking GitLab Shell ...

GitLab Shell version >= 1.9.6 ? ... OK (2.0.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
Satellites access is drwxr-x---? ... yes
update hook up-to-date? ... no
Could not find /home/git/gitlab-shell/hooks/update
  Try fixing it:
  Check the hooks_path in config/gitlab.yml
  Check your gitlab-shell installation
  For more information see:
  doc/install/installation.md in section "GitLab Shell"
update hooks in repos are links: ... can't check because of previous errors
Running /home/git/gitlab-shell/bin/check
Check GitLab API access: OK
Check directories and files:
    /home/git/repositories/: OK
    /home/git/.ssh/authorized_keys: OK
Test redis-cli executable: redis-cli 2.8.13
Send ping to redis server: PONG
gitlab-shell self-check successful

Checking GitLab Shell ... Finished

Checking Sidekiq ...

Running? ... yes
Number of Sidekiq processes ... 1

Checking Sidekiq ... Finished

Checking LDAP ...

LDAP is disabled in config/gitlab.yml

Checking LDAP ... Finished

Checking GitLab ...

Database config exists? ... yes
Database is SQLite ... no
All migrations up? ... yes
Database contains orphaned UsersGroups? ... no
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 namespace: ...
Administrator / html5 ... yes
Projects have satellites? ...
Administrator / html5 ... 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 (2.1.0)

Checking GitLab ... Finished

gao@gao-VirtualBox:/home/git/gitlab$

分享到:
评论

相关推荐

    Git发现git push origin master 报错的解决方法

    git push origin master 报错的解决方法,分享给大家,... [rejected] master -> master (fetch first) error: failed to push some refs to 'git@github.com:kangvcar/Results-Systems--PHP.git' hint: Updates were r

    java坑爹的笔试题-gitee-bullshit-codes:从https://gitee.com/oschina/bullshit-cod

    java坑爹的笔试题 没有最坑,只有更坑! 活动简介 作为一个程序员,你看过哪些坑爹代码,你又写过多少坑爹代码,还有多少你不知道的坑爹代码?本仓库的目的就是为了收集这些坑爹代码,可以让别人不掉坑或者少掉坑,...

    执行git push会遇到的问题

    执行push会遇到的问题: (1)出现Everything up-to-date 原因是: 1、没有git add, 2、没有git commit -m “提交信息” 或创建的目录下是空的 ... [rejected] master -> master (fetch first) 原因是远程仓库上有

    idea上传代码到github时遇到的Push rejected: Push to origin/master was rejected

    当新创建的github仓库里已经有文件时,如果使用idea上传项目到这个仓库就会报错:Push rejected: Push to origin/master was rejected。 完整步骤记录及解决方法: 一、创建本地仓库: 选中我们需要创建本地仓库的...

    智能停车场

    if (onlineMonitoring->exec() == QDialog::Rejected) { this->show(); } } /*------------------------------------------- * * 人事信息 * ---------------------------------------------*/ void ...

    Python库 | rejected-3.18.4-py2.py3-none-any.whl

    python库。 资源全名:rejected-3.18.4-py2.py3-none-any.whl

    Python库 | rejected-peps-0.2.2.tar.gz

    资源分类:Python库 所属语言:Python 资源全名:rejected-peps-0.2.2.tar.gz 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059

    laravel-model-status:轻松向模型添加状态

    $ model -> setStatus ( 'rejected' , 'My rejection reason' ); // get the current status $ model -> status (); // returns an instance of \Spatie\ModelStatus\Status // get the previous

    Python库 | rejected_peps-0.2.5-py3-none-any.whl

    python库。资源全名:rejected_peps-0.2.5-py3-none-any.whl

    git push rejected

    git push rejectedgit push rejectedgit push rejectedgit push rejectedgit push rejectedgit push rejectedgit push rejectedgit push rejectedgit push rejectedgit push rejectedgit push rejectedgit push ...

    Python库 | rejected-3.21.0.tar.gz

    python库。 资源全名:rejected-3.21.0.tar.gz

    windows版curl

    --cut-dirs=NUMBER ignore NUMBER remote directory components. HTTP options: --http-user=USER set http user to USER. --http-passwd=PASS set http password to PASS. -C, --cache=on/off ...

    identywaf.zip

    Usage: python identYwaf.py [options] |url> Options: --version Show program's version number and exit -h, --help Show this help message and exit --delay=DELAY Delay (sec) between tests (default: 0)...

    Rabbitmq_Demo

    流程:producer > Exchange > Queue -处-理-失-败-> DeadLetter Exchange > DeadLetter Queue具体流程看图3和图4。注:使用死信队列时,一定需要设置属性spring.rabbitmq.listener.simple.default-requeue-rejected=...

    测试培训教材

    选择菜单“需求->转换为测试->转换选定需求” 将最底层的子要求转换为测试 把Cruise Seatch转换为步骤、再次转换为测试 选择主题路径: 查看转换结果: 练习2:从Office导入需求到QC 参考 ...

    Python库 | rejected_peps-0.1.1-py3-none-any.whl

    资源分类:Python库 所属语言:Python 资源全名:rejected_peps-0.1.1-py3-none-any.whl 资源来源:官方 安装方法:https://lanzao.blog.csdn.net/article/details/101784059

Global site tag (gtag.js) - Google Analytics