我有点走投无路了。我想通过 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/访问日志
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 [email protected]
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
答案1
在空的 repo 中,您必须先创建一个分支,然后才能提交:
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
。
看 ”为什么我需要明确地推送一个新分支?“以了解有关初始步骤的更多信息。
如果你不创建分支,那么你将提交分离头,从未被推送(因此在远程 gitolite 端没有可见的变化)
答案2
我在使用 gitolite 设置智能 http 时也遇到了一些问题。成功完成后,我在博客中写了一篇如何操作邮政。