Git - 从子模块推送对master的更改?

时间:2017-05-07 05:22:47

标签: git git-submodules

我有两个git存储库,AB

A是其他项目喜欢使用的库。它只有一个分支master

B中,我将A添加为子模块,因此将其克隆到B的目录中。 HEAD未被分离,因为我说在添加时跟踪分支master

在我的项目B中,我注意到A代码中存在错误。我更改了子模块A(位于B目录中的克隆代码)内的代码。我现在想要将A中的B提交的更改提交到A的主分支,使B仍为零提交。

如何做到这一点?

实施例

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?  

0 个答案:

没有答案