2016-04-30 51 views
1

任何想法,爲什麼這不起作用:不能訪問的git reposoitory

D:\apache-tomcat-8.0.33\bin>"C:\Program Files\Git\bin\git.exe" -c core.askpass=true ls-remote -h https://[email protected]/shares/githome/Repo.git HEAD 
fatal: repository 'https://[email protected]/shares/githome/Repo.git/' not found 

我可以使用Eclipse成功克隆了這個倉庫:

Screenshot of eclipse (that works)

回答

0

在Eclipse中,您使用的是SSH,而在命令行中使用的是HTTPS。這是兩種不同的協議,一個人工作的事實並不一定意味着另一個人也會工作。嘗試使用SSH網址:

"C:\Program Files\Git\bin\git.exe" -c core.askpass=true ls-remote -h ssh://[email protected]/shares/githome/Repo.git HEAD 
0

關於WD MyCloud, you will find tutorial to access a git repo through ssh,這是相當容易安裝,考慮到你所需要的只是一個sshd運行。

但是,要使https網址正常工作,您需要運行一個Apache服務器,properly configured以支持git http-backend
沿an httpd.conf線包括一些:

# Configure Git HTTP Backend 
SetEnv GIT_PROJECT_ROOT /www/example.com/git 
SetEnv GIT_HTTP_EXPORT_ALL 
# Note: Serve static files directly 
AliasMatch ^/(.*/objects/[0-9a-f]{2}/[0-9a-f]{38})$   /var/www/git/$1 
AliasMatch ^/(.*/objects/pack/pack-[0-9a-f]{40}.(pack|idx))$ /var/www/git/$1 
# Note: Serve repository objects with Git HTTP backend 
ScriptAliasMatch \ 
     "(?x)^/(.*/(HEAD | \ 
        info/refs | \ 
        objects/info/[^/]+ | \ 
        git-(upload|receive)-pack))$" \ 
     /usr/libexec/git-core/git-http-backend/$1 

而不是標準的,除非你設置它事先自己。