首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >为什么它不让我提交我的子模块?

为什么它不让我提交我的子模块?
EN

Stack Overflow用户
提问于 2015-07-16 20:40:50
回答 1查看 42关注 0票数 1

所以我最近做了:

代码语言:javascript
复制
git submodule foreach git submodule foreach git pull origin master

我得到了一个巨大的输出,因为它拉和更新这些子模块的最新和最伟大的。然后我做了:

代码语言:javascript
复制
vagrant@vagrantpress:/vagrant/Freya-Vagrant$ git status
On branch master
Your branch is up-to-date with 'origin/master'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)
  (commit or discard the untracked or modified content in submodules)

        modified:   local-dev/content/mu-plugins/Freya-MU (modified content)
        modified:   local-dev/content/themes/freya-theme (modified content)

no changes added to commit (use "git add" and/or "git commit -a")
vagrant@vagrantpress:/vagrant/Freya-Vagrant$ git commit -a
On branch master
Your branch is up-to-date with 'origin/master'.

Changes not staged for commit:
        modified:   local-dev/content/mu-plugins/Freya-MU (modified content)
        modified:   local-dev/content/themes/freya-theme (modified content)

no changes added to commit
vagrant@vagrantpress:/vagrant/Freya-Vagrant$ git add -A
vagrant@vagrantpress:/vagrant/Freya-Vagrant$ git commit -a
On branch master
Your branch is up-to-date with 'origin/master'.

Changes not staged for commit:
        modified:   local-dev/content/mu-plugins/Freya-MU (modified content)
        modified:   local-dev/content/themes/freya-theme (modified content)

no changes added to commit
vagrant@vagrantpress:/vagrant/Freya-Vagrant$

但正如你所看到的,它不会提交,因为显然没有变化?我不明白这个。,到底怎么回事?

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2015-07-17 06:42:34

这是因为更改在git子模块项目中,而不是根项目中。

https://git-scm.com/book/en/v2/Git-Tools-Submodules的文档之后,您可能希望执行如下操作:

代码语言:javascript
复制
cd local-dev/content/mu-plugins/Freya-MU
git checkout master # or some other branch
git submodule update --remote --merge

# make edits, e.g.:
vi README.md 
git commit -m "test" README.md

git submodule update --remote --rebase
git push --recurse-submodules=check  # follow the output from this command
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/31464122

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档