【问题标题】:eclipse is always complaining about remote git does not supoort smart http pusheclipse老是抱怨远程git不支持智能http推送
【发布时间】:2013-05-01 20:05:40
【问题描述】:

我知道网上有一些与这个话题相关的问题,但是我把它们挖出来后仍然无法解决。

在服务器端,我有一个存储库位于:/opt/gitrepo/kindtest.git,在 /etc/apache2/conf.d/git 中,我写道:

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>

重启 apache 后,我可以通过 http:///gitrepo/ 在浏览器中查看我的 git 存储库。 但是,当我尝试使用 eclipse 对 http:///gitrepo/kindtest.git 进行 http 推送时,我总是收到一个错误,说远程不支持智能 http 推送。

额外信息:我还通过 /etc/apache2/conf.d/gitweb 启用了 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>

服务器端:git版本1.7.9.5,在kindtest.git/config中:

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

客户端:使用 egit 进行eclipse

我有什么遗漏的吗?

【问题讨论】:

  • 通过命令行 git 推送是否适用于指定的 URL?
  • @robinst 是的,刚刚尝试过,在 CLI 下推送可以工作,但不能使用 egit,猜测 egit 需要在服务器上设置智能 http。

标签: eclipse git http push egit


【解决方案1】:

我终于明白了,是 git-http-backend 没有运行,所以智能 http 总是被禁用。我删除了与第二个 ScriptAlias 重叠的“Alias /gitrepo /opt/gitrepo”行。现在我可以使用 egit 将源推送到远程服务器。

【讨论】:

    猜你喜欢
    • 2011-09-10
    • 2016-07-08
    • 2021-12-16
    • 2015-08-14
    • 2016-08-25
    • 2021-06-20
    • 2012-07-25
    • 2016-12-24
    • 1970-01-01
    相关资源
    最近更新 更多