Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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       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
share|improve this question
    
Is it an empty repository? Did you commit within a branch? what git branch -avvv return? –  VonC Aug 7 '13 at 11:39
    
'$ git branch -avvv' returns nothing, empty. Yes, testing is an empty repository, and I am committing from master.. –  Florian Mertens Aug 7 '13 at 11:43
add comment

2 Answers

up vote 1 down vote accepted

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)

share|improve this answer
    
...so in short: There was no error. @VonC, you're a master! I was looking at a working installation! –  Florian Mertens Aug 7 '13 at 12:03
add comment

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

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.