2016-10-19 146 views
0

昨天我在服務器上安裝了GitLab Community Edition。安裝了罰款,但是當我們將數據或文件到GitLab服務器時出現此錯誤:遠程GitLab API無法訪問

Password for 'http://[email protected]@112.196.23.228': 
Counting objects: 6, done. 
Delta compression using up to 2 threads. 
Compressing objects: 100% (2/2), done. 
Writing objects: 100% (6/6), 431 bytes | 0 bytes/s, done. 
Total 6 (delta 0), reused 0 (delta 0) 
remote: GitLab: API is not accessible 
To http://112.196.23.228/Naman/mt-test.git 
! [remote rejected] master -> master (pre-receive hook declined) 
error: failed to push some refs to 'http://112.196.23.228/Naman/mt-test.git' 
+0

你在'gitlab.rb'中設置了'external_url'嗎? – Fairy

+0

是的,我已經在我的gitlab.rb文件中設置了external_url。 –

+0

[Git push error pre-receive hook refused]可能重複(http://stackoverflow.com/questions/28318599/git-push-error-pre-receive-hook-declined) –

回答

1

檢查以確保該分支主是不受保護的。據我瞭解,主分支默認情況下受到保護。 Example

您可以取消/保護項目設置中的分支。

您還可以檢查在位於/opt/gitlab/embedded/service/gitlab-shell/config.yml的gitlab-shell配置中正確設置了gitlab_url。確保在編輯此文件後運行sudo gitlab-ctl restart