我有一个Git子模块,我已经成功克隆到我的主项目中。但是,当我在子模块中进行更改并尝试将其推回原始子模块存储库时,Git拒绝执行此操作。为什么,我该如何解决这个问题?在Git中推子模块更改
例子:我有两个单独的文件夹的子工程和项目超。我把super作为submodule包含在super中。我在文件夹super/sub中进行更改,然后尝试将这些更改推送到原始项目子文件夹中。 Git抱怨。
编辑:关于错误消息,我在Windows上使用Git Bash,很遗憾,无法从终端复制出确切的错误消息。这里是最相关的行:
remote: error: refusing to update checked out branch: refs/heads/master. By default, updating the current branch in a non-bare repository is denied, because it will make the index and work tree inconsistent with what you pushed, and will require 'git reset --hard' to match the work tree to HEAD.
注意:这两个存储库住在我的硬盘上。
这是什么混帐说什么? – Stefan
@Stefan,见编辑。 – astay13