如何自动将所有符号链接转换为repo中的git子模块

问题描述 投票:0回答:1

如何在一些仓库中自动将所有符号链接转换为git子模块。

我想做一些类似的事情,我在客户端:

folder1(repo1) 
| 
+--folderA--file.a 

folder2(repo2) 
| 
+--symlink to folderA 

我想在服务器端将它转换为git子模块:

repo1 
| 
+--FolderA--file.a 

repo2 
| 
+-- git submodule to folderA in repo1.. 

回购1和回购2是我的。

(我需要这样的东西:

我有客户端folder1 inicializated为repo1,我有folder2 inicializated为repo2,我有从文件夹2中的一个文件夹到folder1中的一个文件夹的符号链接。我需要它在服务器端(git服务器)所有符号链接转换为git子模块 - > repo2中的文件夹是子模块到repo1中的文件夹。)

(我的英语是sry),我正在使用谷歌翻译,有时翻译非常糟糕。

git git-submodules symlink
1个回答
0
投票

除非您知道符号链接指向的远程repo URL,否则您无法自动执行此操作。

如果这样做,请删除符号链接,然后键入:

git submodule add ../path/to/other/repo/.git otherRepo

但在你的情况下,那将克隆repo1,而不是folderA

repo2
|
+ repo1
  |
  + folderA

如果你打算从repo2/repo1/folderA提交并推回,最好引用bare repo版本的repo1(一个repo1.git

© www.soinside.com 2019 - 2024. All rights reserved.