Httpd

Gitolite3不寫

  • August 7, 2013

我在這裡有點世界末日。我想通過 apache 安裝 gitolite3 smart http。我可以成功拉,但不能推(甚至沒有給我任何錯誤或通知,甚至在任何已知的日誌中都沒有)。我已經禁用了 selinux,直到我弄清楚出了什麼問題。我的作業系統是 CentOS6.4。我正在粘貼所有相關的配置文件和日誌,但它們看起來都很好..

我要看的下一步是什麼?

有人可以告訴我他們的推送呼叫的 gitolite3 日誌條目是否與下面我的不同?

過程:

$ git clone http://flo@server/git/testing
$ cd testing/
$ echo "This is a test" > testing.txt
$ git add testing.txt 
$ git status
$ git commit -am "Added test file"
$ git status
$ git push http://flo@server/git/testing
$ cd ..
$ rm -rf testing
$ git clone http://flo@server/git/testing
$ ll testing
total 0

/etc/httpd/logs/access_log

10.42.43.1 - - [07/Aug/2013:11:43:09 +0100] "GET /git/testing/info/refs?service=git-upload-pack HTTP/1.1" 401 481 "-" "git/1.7.1"
10.42.43.1 - uncleflo [07/Aug/2013:11:43:09 +0100] "GET /git/testing/info/refs?service=git-upload-pack HTTP/1.1" 200 38 "-" "git/1.7.1"
10.42.43.1 - - [07/Aug/2013:11:44:01 +0100] "GET /git/testing/info/refs?service=git-receive-pack HTTP/1.1" 401 481 "-" "git/1.7.1"
10.42.43.1 - uncleflo [07/Aug/2013:11:44:01 +0100] "GET /git/testing/info/refs?service=git-receive-pack HTTP/1.1" 200 151 "-" "git/1.7.1"
10.42.43.1 - - [07/Aug/2013:11:54:54 +0100] "GET /git/testing/info/refs?service=git-upload-pack HTTP/1.1" 401 481 "-" "git/1.7.1"
10.42.43.1 - uncleflo [07/Aug/2013:11:54:54 +0100] "GET /git/testing/info/refs?service=git-upload-pack HTTP/1.1" 200 38 "-" "git/1.7.1"

/etc/httpd/logs/suexec.log

[2013-08-07 11:43:09]: uid: (650/gitolite3) gid: (650/gitolite3) cmd: gitolite-suexec-wrapper.sh
[2013-08-07 11:44:01]: uid: (650/gitolite3) gid: (650/gitolite3) cmd: gitolite-suexec-wrapper.sh
[2013-08-07 11:54:54]: uid: (650/gitolite3) gid: (650/gitolite3) cmd: gitolite-suexec-wrapper.sh

/var/lib/gitolite3/.gitolite/logs/gitolite-2013-08.log

2013-08-07.11:43:09 6104        access(testing, uncleflo, R, 'any'),-> refs/.*
2013-08-07.11:43:09 6104        trigger,Writable,access_1,ACCESS_1,testing,uncleflo,R,any,refs/.*
2013-08-07.11:43:09 6104    pre_git testing uncleflo    R   any -> refs/.*
2013-08-07.11:43:09 6104        system,git,http-backend
2013-08-07.11:43:09 6104    END
2013-08-07.11:44:01 6122        access(testing, uncleflo, W, 'any'),-> refs/.*
2013-08-07.11:44:01 6122        trigger,Writable,access_1,ACCESS_1,testing,uncleflo,W,any,refs/.*
2013-08-07.11:44:01 6122    pre_git testing uncleflo    W   any -> refs/.*
2013-08-07.11:44:01 6122        system,git,http-backend
2013-08-07.11:44:01 6122    END
2013-08-07.11:54:55 6226        access(testing, uncleflo, R, 'any'),-> refs/.*
2013-08-07.11:54:55 6226        trigger,Writable,access_1,ACCESS_1,testing,uncleflo,R,any,refs/.*
2013-08-07.11:54:55 6226    pre_git testing uncleflo    R   any -> refs/.*
2013-08-07.11:54:55 6226        system,git,http-backend
2013-08-07.11:54:55 6226    END

對於測試倉庫:gitolite-admin/conf/gitolite.conf

repo testing
   RW+     =   @all
   RW+     =   daemon

/etc/httpd/conf.d/gitolite3.conf

<VirtualHost *:80>
#    ServerName        git.example.com
#    ServerAlias       git
#    ServerAdmin       you@example.com

   DocumentRoot /var/www/git
   <Directory /var/www/git>
       Options       None
       AllowOverride none
       Order         allow,deny
       Allow         from all
   </Directory>

   SuexecUserGroup gitolite3 gitolite3
   ScriptAlias /git/ /var/www/bin/gitolite-suexec-wrapper.sh/
   ScriptAlias /gitmob/ /var/www/bin/gitolite-suexec-wrapper.sh/

   <Location /git>
       AuthType Basic
       AuthName "Git Access"
       Require valid-user
       AuthUserFile /etc/httpd/git.passwd
   </Location>
</VirtualHost>

/var/www/bin/gitolite-suexec-wrapper.sh

#!/bin/bash
#
# Suexec wrapper for gitolite-shell
#

export GIT_PROJECT_ROOT="/var/lib/gitolite3/repositories"
export GITOLITE_HTTP_HOME="/var/lib/gitolite3"

exec /usr/share/gitolite3/gitolite-shell

在空倉庫中,您必須先創建一個分支,然後再送出:

git checkout -b master         # creates the master branch
echo ...                       # creates the test file
git commit -am "first commit"  # commit in the right branch
git push -u origin master      # actually push something

下一次推送將只需要一個git push.

有關初始步驟的更多資訊,請參閱“為什麼我需要顯式推送新分支? ”。

如果您不創建分支,那麼您將送出一個**分離的 head**,它永遠不會被推送(因此遠端 – gitolite – 側缺乏可見的更改)

引用自:https://serverfault.com/questions/529291