我 merge 了两个分支。现在,当我尝试 git add .
时,命令会忽略一个文件夹。然后我运行'git status',它以红色显示-'modified:admin'。
$ git status
# On branch 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 d
# (commit or discard the untracked or modified content in submodul
#
# modified: admin (modified content)
#
no changes added to commit (use "git add" and/or "git commit -a")
如何将更改提交给管理员?
最佳答案
admin
不是文件
这条消息:
# modified: admin (modified content)
表示admin
是一个子模块。
这是一个处于脏状态的子模块——其中有未提交的更改。从主存储库中没有要提交的更改,因为子模块的存储库没有更改,因此如果您尝试提交这种情况,则不会发生任何事情,但是您会收到一条警告,指出子模块包含“已修改的内容”。
如何提交更改
子模块需要更新,以便主存储库能够引用这些更改,即:
cd admin
git commit -va
# review and then commit the changes
git push # important if you want to be able to access this change elsewhere
cd ..
git add admin
git commit admin -m "bumping admin submodule"
如果子模块不是您自己的代码,这很可能不是您想要做的 - 在这种情况下,请解释(通过编辑问题)目标,即更改的目的一个依赖。
关于git - “混帐添加。”两个分支的 merge 命令后不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20122419/