git子树-在子模块上看不到更改

时间:2018-06-28 08:13:53

标签: git git-subtree

我正在尝试将git子树与父项目以及所有结构化的模块一起使用:

parent       
   |__ mod_commons
   |__ mod_model

下面是步骤的示例:

[from parent]
git flow feature start *branch_subtree*

git remote add -f commons <url_remote.git> 

git subtree add --prefix mod_commons commons develop --squash

现在,mod_commons项目从development下拉,它指向 feature_branch_subtree

mod_commons (feature/branch_subtree)

然后,来自父母:

git subtree push --mod_commons commons feature_branch_subtree

通过这种方式,我将功能添加到公共资源库

问题

我执行以下步骤:

  • 我在 mod_commons
  • 中添加了文件 foo
  • 我在mod_commons中添加,提交和git push foo

现在,我希望可以在我的远程分支上看到更改,但事实并非如此!

我只能在父项目的branch_subtree内看到添加的文件,而commons远程仓库在最后一次 develop 提交时仍保持静止。

为什么?

编辑 而且,我从父母那里尝试:

 git subtree pull --prefix mod_commons commons feature/branch_subtree

From <remote_repo_commons.git>
 * branch              feature/branch_subtree -> FETCH_HEAD
fatal: refusing to merge unrelated histories

0 个答案:

没有答案
相关问题