我有以下
project_main
--test1.txt
--text2.txt
--.git
--new_folder <-- currently its local repo
--test1.txt
--text2.txt
--.git
现在在new_folder
我做的
# inside new_folder
git add remote git:someurl
git add -A; git commit -m "first commit"
git push -u origin master
现在如何将new_folder
as添加submodule
到project_main
通常我们添加子模块使用(即获取一些远程仓库)
git submodule add -- git://someurl new_folder
但在这里我希望将新创建的 repo 添加为子模块。
将new_folder
父存储库移出并为其创建一个单独的存储库并推送。然后,
cd project_main
git submodule add --name new_folder file:///path/to/new_folder
git add new_folder/
git commit -m 'new_folder is a submodule'
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句