Kevin
Kevin

Reputation: 587

eclipse is always complaining about remote git does not supoort smart http push

I know there are a few questions related to this topic on the Internet but I just still cannot solve the problem after digging them out.

On the server side, I have a repository located at: /opt/gitrepo/kindtest.git, and in /etc/apache2/conf.d/git, I wrote:

Alias /gitrepo /opt/gitrepo
SetEnv GIT_PROJECT_ROOT /opt/gitrepo/
SetEnv GIT_HTTP_EXPORT_ALL
SetEnv REMOTE_USER=$REDIRECT_REMOTE_USER
ScriptAliasMatch \
    "(?x)^/gitrepo/(.*/(HEAD | \
                    info/refs | \
                    objects/(info/[^/]+ | \
                             [0-9a-f]{2}/[0-9a-f]{38} | \
                             pack/pack-[0-9a-f]{40}\.(pack|idx)) | \
                    git-(upload|receive)-pack))$" \
    "/usr/lib/git-core/git-http-backend/$1"
<Location /gitrepo>
    Options +Indexes +FollowSymLinks +ExecCGI
    #AuthType Basic
    #AuthName "git repository"
    #AuthUserFile /var/git/.htpasswd
</Location>

After restarted apache, I could view my git repositories in a browser by http:///gitrepo/. However when I tried to use eclipse to do a http push to http:///gitrepo/kindtest.git, I always got an error saying remote does not support smart http push.

Extra info: I have also had gitweb enabled by /etc/apache2/conf.d/gitweb:

Alias /gitweb /usr/share/gitweb
<Directory /usr/share/gitweb>
    Options FollowSymLinks +ExecCGI
    AddHandler cgi-script .cgi

    AuthType Basic
    AuthName "Gitweb"
    AuthUserFile /home/.htpasswd
    Require valid-user
</Directory>

Server side: git version 1.7.9.5, and in kindtest.git/config:

[core] 
    repositoryformatversion = 0
    filemode = true
    bare = true
[http] 
    getanyfile = true
    uploadpack = true
    receivepack = true

Client side: eclipse with egit

Is there anything I have missed?

Upvotes: 3

Views: 3510

Answers (1)

Kevin
Kevin

Reputation: 587

I finally figured this out, it was git-http-backend that wasn't functioning so smart http was alwasy disabled. I removed the line "Alias /gitrepo /opt/gitrepo" which overlaps the second ScriptAlias. Now I can use egit to push source to remote server.

Upvotes: 2

Related Questions