2

I am a bit at world's end here. I want to install gitolite3 smart http over apache. I can successfully pull, but not push (doesn't even give me any errors or notices, not even in any known log). I have disabled selinux until I figure out whats wrong. My OS is CentOS6.4. I'm pasting all my relevant confs and logs, but they all seem fine..

What is(are) the next step(s) for me to look at?

Can someone tell me if their gitolite3 log entries for pushed calls are different than mine below?

Process:

$ 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

For the testing repo: 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
2
  • Is it an empty repository? Did you commit within a branch? what git branch -avvv return?
    – VonC
    Aug 7, 2013 at 11:39
  • '$ git branch -avvv' returns nothing, empty. Yes, testing is an empty repository, and I am committing from master.. Aug 7, 2013 at 11:43

2 Answers 2

1

In an empty repo, you must first create a branch before committing:

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

The next push will only need a git push.

See "Why do I need to explicitly push a new branch?" for more on that initial step.

If you don't create a branch, you are committing in a detached head, which is never pushed (hence the lack of visible changes on the remote -- gitolite -- side)

1
  • ...so in short: There was no error. @VonC, you're a master! I was looking at a working installation! Aug 7, 2013 at 12:03
0

I also got some problem while setting smart http with gitolite. After successfully done I wrote a how to in my blog post.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .