无法将代码推送到gitlab存储库

时间:2018-09-09 04:29:50

标签: github gitlab git-repo

项目所有者(michael365)维护一个存储库,并向开发人员提供了对我的访问权限。我正在尝试推送代码,但出现此错误

remote: GitLab: API is not accessible
    To gitlab.com:michael365/bim.git
     ! [remote rejected] master -> master (pre-receive hook declined)
    error: failed to push some refs to 'git@gitlab.com:michael365/bim.git'

尽管我已在SSH部分中设置了公钥,但它仍然无法正常工作。我正在发出以下命令

$ git add .

$ git commit -m "Adding Initial Code"
On branch master
nothing to commit, working tree clean

$ git push
fatal: The current branch master has no upstream branch.
To push the current branch and set the remote as upstream, use

    git push --set-upstream origin master

$ git push --set-upstream origin master
Counting objects: 3, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (3/3), 868 bytes | 868.00 KiB/s, done.
Total 3 (delta 0), reused 0 (delta 0)
remote: GitLab: API is not accessible
To gitlab.com:michael365/bim.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git@gitlab.com:michael365/bim.git'

任何建议都会有所帮助

1 个答案:

答案 0 :(得分:1)

pre-receive hook declined表示在对要推送的更改进行内容检查失败之后,您的推送被远程存储库拒绝。

请问远程仓库的管理员,如检查拒绝您的推送。通常您会收到一条正确的错误消息,指出什么检查失败。

相关问题