2017-06-06 32 views
1

我嘗試使用相對URL添加子樹:如何使用子樹的相對url?

> git subtree add --prefix child ../child.git master --squash 
git fetch ../child.git master 
fatal: '../child.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. 

../child.git,相對於這個倉庫的遙控器,一個Git倉庫,我有充分的權利。你可以看到這一點,如果我嘗試將其添加爲一個子模塊:

> git submodule add ../child.git child 
Cloning into 'D:/code/jjj/subtree/parent/child'... 
remote: Counting objects: 3, done. 
remote: Total 3 (delta 0), reused 0 (delta 0) 
Unpacking objects: 100% (3/3), done. 

,如果我用一個絕對的URL,我可以添加這個孩子的存儲庫作爲子樹罰款,如果我使用,我可以罰款添加它作爲一個子模塊一個相對URL。

是否有可能,我將其添加爲使用相對URL一個子樹

回答

1

當我問這個問題時,我從根本上誤解了子樹。

子樹不保持與「子」存儲庫的連接。相反,從回購的文件被讀入,就是這樣。

因此,使用相對路徑沒有意義或需要。相反,應該使用絕對路徑(如果使用URL - 可以使用相對的文件路徑)。

相關問題