[英]Git server with git daemon seem to not care about --base-path
我已經在我的服務器上設置了 git 守護進程,以便按照官方文檔擁有我的個人 git repo。 盡管如此, --base-path
似乎無法按預期或描述中指定的方式工作。
我希望能夠將 repo 克隆為: git clone git@myserver.com:path/to/repo.git
而不必指定git clone git@myserver.com:/where/git/user/home/is/path/to/repo.git
我的 git 守護進程服務如下:
/usr/bin/git daemon --export-all --reuseaddr --base-path=/home/git/data/ /home/git/data/
然后我在/home/git/data/gns/
中創建了一個基本倉庫( gns
就像一個“組”,我將有幾個倉庫):
git init --bare gns/api.git
在本地,當我嘗試克隆它時出現錯誤:
┌──(kali㉿kali)-[~]
└─$ git clone git@myserver.com:gns/api.git
Cloning into 'api'...
Enter passphrase for key '/home/kali/.ssh/id_ed25519':
fatal: 'gns/api.git' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
但有趣的是這個工作(?!):
┌──(kali㉿kali)-[~]
└─$ git clone git@myserver.com:data/gns/api.git
Cloning into 'api'...
Enter passphrase for key '/home/kali/.ssh/id_ed25519':
warning: You appear to have cloned an empty repository.
知道發生了什么嗎? 為什么使用數據/它有效? 我錯過了什么才能正確地做到這一點?
謝謝
根據我對Git 守護進程的了解,這是用於使用“Git”協議為存儲庫提供服務。
表示以git://...
但是您沒有使用此類 URL,而是使用 SSH URL,使用遠程用戶git
連接到myserver.com
,其中 home ( /home/git
) 有一個data/gns/api.git
文件夾。
這意味着守護程序不會與此類 URL 一起使用。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.