2014-02-12 23 views
0

GIT主目錄是/與下面的配置SRV/gitolite:GIT:未能一些裁判推到 '用戶名@服務器:倉庫/ project.git' 在服務器上

[email protected]:~/repositories$ ls -al /srv/gitolite/repositories/ 
total 20 
drwxr-x--- 5 gitolite gitolite 4096 Feb 12 21:23 . 
drwxr-x--- 8 gitolite gitolite 4096 Feb 12 21:23 .. 
drwx------ 8 gitolite gitolite 4096 Feb 12 21:23 gitolite-admin.git 
drwxrwx--- 7 gitolite gitolite 4096 Feb 12 21:23 project.git 
drwx------ 7 gitolite gitolite 4096 Feb 12 21:23 testing.git 

gitolite @服務器:/ $貓/srv/gitolite/.gitolite/conf/gitolite.conf

repo gitolite-admin 
      RW+  = admin 

    repo testing 
      RW+  = @all 

    repo project 
      RW+  = user 

[email protected]:/$ ls -al /srv/gitolite/.gitolite/keydir/ 
drwx------ 2 gitolite gitolite 4096 Feb 12 20:55 . 
drwx------ 8 gitolite gitolite 4096 Feb 10 23:03 .. 
-rw-r--r-- 1 gitolite gitolite 404 Feb 10 23:03 admin.pub 
-rw-rw---- 1 gitolite gitolite 404 Feb 11 22:30 user.pub 
-rw-rw---- 1 gitolite gitolite 393 Feb 12 20:55 test.pu 

在本地機器上我所做的:

[email protected]:/tmp$ mkdir test 
[email protected]:/tmp$ cd test/ 
[email protected]:/tmp/test$ vim file.txt 
[email protected]:/tmp/test$ git init 
Initialized empty Git repository in /tmp/test/.git/ 
[email protected]:/tmp/test$ git remote add origin [email protected]:repositories/project.git 
[email protected]:/tmp/test$ git add . 
[email protected]:/tmp/test$ git commit -m 'test' 
[master (root-commit) cb6bc87] test 
1 file changed, 1 insertion(+) 
create mode 100644 test.txt 
[email protected]:/tmp/test$ git push origin master:refs/heads/master 
Counting objects: 3, done. 
Writing objects: 100% (3/3), 215 bytes, done. 
Total 3 (delta 0), reused 0 (delta 0) 
remote: ENV GL_RC not set 
remote: BEGIN failed--compilation aborted at hooks/update line 20. 
remote: error: hook declined to update refs/heads/master 
To [email protected]:repositories/project.git 
! [remote rejected] master -> master (hook declined) 
error: failed to push some refs to '[email protected]:repositories/project.git' 

爲什麼我不能推項目file.t xt到GIT服務器?我必須更改服務器上的某些權限嗎?或者我做錯了什麼?

感謝您的任何建議。

+0

您的問題肯定是這片:'混帳推起源主:裁判/ heads/master'嘗試'git push --set-upstream origin master' – sircapsalot

+0

[gitolite push error - > remote:ENV GL \ _RC not set]的可能重複(http://stackoverflow.com/questions/5233058/gitolite -push-error-remote-env -gl -rc-not-set) – jszakmeister

+0

@sircapsalot'git push --set-ups ream原點大師「沒有幫助。還是同樣的錯誤:-( – martin

回答

1

我在試圖上傳到Bitbucket.org時處理了這個錯誤。 我必須先添加我的SSH密鑰。

雖然你正在運行你自己的Git服務器,這可能會有所幫助。

我運行git push -u origin master#-u標誌告訴Git第一次推送到哪個分支。

如果這不起作用,您可能需要先嚐試拉動然後再按下。

+0

是的,我有我自己的git服務器(debian上的gitolite)。我的SSH密鑰位於服務器/home/user/.ssh/user.pub和/srv/gitolite/.gitolite/上keydir/user.pub 我得到了同樣的錯誤,當我使用'混帳推-u起源master'的。 我不能使用拉出指令。難道我什麼了嗎? '$ git的拉 沒有跟蹤信息對於 當前分支,請指定要與合併哪個分支。 請查看git-拉(1)瞭解詳細信息 混帳拉 如果要設置這個分支,你可以一切都做得那麼跟蹤信息o與: git分支 - 設置上游主產地/ ' – martin

0

在任何有關gitolite的教程中,我都找不到一個謎題: 請注意,gitolite存儲庫始終以「gitolite」用戶的身份訪問。 gitolite會通過您的SSH密鑰識別您的實際用戶並使用適當的權限。

我不能使用:

git remote add origin [email protected]:repositories/project.git 

,但我必須使用登錄名gitolite(通用於所有賬戶)

git remote add origin [email protected]:repositories/project.git