0
我有两个Git仓库,A
和B
Git - 将变更从子模块推送给主模块?
A
是,其他项目都爱用的库。它只有一个分支master
。
在B
中,我添加了A
作为子模块,因此它将它克隆到B
的目录中。 HEAD
不是分离的,因为我说跟踪分支master
添加时。
在我的项目B
里面,我注意到A
的代码中存在一个错误。我更改子模块A
(位于B
的目录内的克隆代码)内的代码。我现在想要将我对A
所作的更改从B
中提交到A
的主分支,而使B
仍然为零。
这怎么办?
Ex。
Projects
|---A # Existing repository. On branch master.
|---B # Repository just created.
git init
git submodule add -b master ../A
git submodule update --remote
cd A/
vi importantFile.txt # Here I make changes to internal files in A
# How do I now commit those changes and add a commit to A?