[英]view the git repository on remote linux server -> in Windows?
[英]How to clone a git repository which is present on a remote linux server into windows
我在遠程服務器XXX.XXX.XXX.XXX上安裝了git存儲庫,並希望在Windows環境中將其克隆。 它實際上是/var/www/html/Testsite
下的一個webapp。 git repo是在Testsite
文件夾中創建的。
我希望命令:
git clone http://XXX.XX.XX.XX/Testsite/mysite.git
可以正常工作,但不能。 請讓我知道如何獲取URL進行配置並將其克隆到我的環境中。
但是,使用本地文件夾,我可以輕松克隆完全正常的存儲庫。
非常感謝。
您不能,如果不配置Apache來處理git請求。
您的mysite.git
位於Testsite
中的事實並不意味着git可以訪問它。
如該配置所示,您可以在單獨的VirtualHost中定義一個配置 (因此,在單獨的端口中,因為您已經在Testing
上使用端口80/443),以便調用能夠解釋git clone請求的git腳本:
ScriptAlias /hgit/ /path/to/git/libexec/git-core/git-http-backend/
SetEnv GIT_HTTP_BACKEND "/path/to/git/libexec/git-core/git-http-backend"
<Location /hgit>
...
</Location>
至於ssh,正確的網址是:
git clone ssh://account@XX.XX.XX.XX/var/www/html/Testsite/mysite.git
而且只有在生成公共和私有(首先是非密碼保護)並在〜account ~account/.ssh/authorized_keys
發布公鑰時,它才起作用。
否則服務器上的sshd(ssh守護程序)將無法識別您(因此要求輸入密碼),並且也不知道“ Testing/
”在哪里。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.