如何提取一个新的子模块 [英] How to pull a new submodule
问题描述
试图在本网站和其他网站上寻找答案: StackOverflow-轻松获取所有子模块的最新版本
Tried looking for answers on this site and others: StackOverflow - Easy way pull latest of all submodules
他们似乎都想谈论您是否在控制它们,而不是别人添加了它们,而我只想将另外一个添加到我的项目中,而不必隐藏或备份我的更改(如果我需要删除它们).文件夹.
They all seem to want to talk about if you are controlling them, not if someone else added one, and I just want to pull the additional one into my project without having to stash or backup my changes if I need to delete the folder.
是否应该删除.gitmodules
文件和/或已经使用git clone --recursive
下拉的子模块目录?
( StackOverflow-如何git clone
包括子模块?)
Should I delete the .gitmodules
file, and/or the submodule directories that I have already pulled down with git clone --recursive
?
(StackOverflow - How to git clone
including submodules?)
这些命令似乎也没有帮助:
These commands do not seem to help either:
-
git submodule update --init --recursive
似乎什么也没做. -
git submodule update --recursive
什么都没有. -
git fetch --recurse-submodules
多次输出Fetching submodule ...
. -
git pull --recurse-submodules
输出相同的内容,然后在获取试用后说Already up-to-date.
.奇怪的是,无论哪种情况,我的子模块都已经下载了. -
git clone --recursive ...
尚未尝试.我想会覆盖在Stash中或其他方面所做的任何更改. -
git submodule update --recursive --remote
为其中一个子模块签出了新的提交SHA. -
git submodule update --recursive
为一个子模块签出了新的提交SHA.可能是较旧的原始提交级别. -
git submodule status
为每种提供适当的SHA,版本和名称信息,而仍然缺少我想要的. -
git submodule foreach git pull origin master
-
git submodule update
不执行任何操作.
git submodule update --init --recursive
seems like it did nothing.git submodule update --recursive
nothing.git fetch --recurse-submodules
outputFetching submodule ...
several times.git pull --recurse-submodules
output the same thing, and then saidAlready up-to-date.
after the fetch trial. Strange since in either case my submodules were already downloaded.git clone --recursive ...
Not tried yet. I feel like would overwrite any changes I have made, in the Stash or otherwise.git submodule update --recursive --remote
checked out a new commit SHA for one of the submodules.git submodule update --recursive
checked out a new commit SHA for one of the submodules. Could be the older, original commit level.git submodule status
gives the appropriate SHA, version, and name information for each, while still lacking the one that I want.git submodule foreach git pull origin master
git submodule update
does nothing.
我一直在手动仔细检查库目录,以确保是否出现了附加子模块.
I have been double-checking the library directory manually each time to make sure whether the additional submodule appeared or not.
我想避免执行某些操作,除非它们不会破坏我当前包含代码更改的存储库状态,并解决了我的问题,以防它是我提到的但没有运行的命令,或者其他任何人都可以执行的操作尝试.
I want to avoid performing certain actions, unless they are not destructive to my current repository state containing code changes, and solves my problem, in case it is a command I have mentioned but did not run, or anyone else has another to try.
我可以更加努力地尝试其中的一些方法,但是我想暂时不要再弄乱它们了,并且由于在进行一些在线搜索后仍未找到该问题的答案,因此可能会有希望而最终的答案无论如何都要帮助别人.
I could try some of these with more effort, but I think I want to stop messing with them for now, and since I have not found the answer to this issue after doing some online searching, maybe the hopeful and eventual answer would help others anyway.
我是否完全遭受了这里提到的骗局? 软件工程-Git子模块与Git克隆
Am I suffering from the con mentioned here at all? Software Engineering - Git submodule vs Git clone
更多链接:
推荐答案
git submodule update --init local/path/to/submodule/folder
这篇关于如何提取一个新的子模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!