Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/git/23.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Linux 将本地repo推送到远程不会使用GIT推送子模块文件_Linux_Git_Version Control_Git Submodules - Fatal编程技术网

Linux 将本地repo推送到远程不会使用GIT推送子模块文件

Linux 将本地repo推送到远程不会使用GIT推送子模块文件,linux,git,version-control,git-submodules,Linux,Git,Version Control,Git Submodules,我是GIT的新手,正在与之斗争。我有一个存储在存储库中的网站。该网站需要一个主题文件夹,该文件夹设置为单独的存储库 我已成功使用git子模块add命令将主题库添加到我的网站 现在我有了一个主题为child Repo的网站Repo。子模块的文件显示在我的网站文件夹中 我试图将整个主网站复制推送到一个远程服务器,该服务器可以工作,但主题(子模块)的文件没有被推送 子模块非常像一个独立的respository——它不知道它是否作为子模块包含在父存储库中。父存储库也不太了解子模块-只是知道它应该在树中的

我是GIT的新手,正在与之斗争。我有一个存储在存储库中的网站。该网站需要一个主题文件夹,该文件夹设置为单独的存储库

我已成功使用
git子模块add
命令将主题库添加到我的网站

现在我有了一个主题为child Repo的网站Repo。子模块的文件显示在我的网站文件夹中


我试图将整个主网站复制推送到一个远程服务器,该服务器可以工作,但主题(子模块)的文件没有被推送

子模块非常像一个独立的respository——它不知道它是否作为子模块包含在父存储库中。父存储库也不太了解子模块-只是知道它应该在树中的位置,提交子模块的位置以及最初从哪个URL克隆它

我不认为有一个命令会为您推送所有子模块-当您更新子模块中的某些文件时,事件的顺序应该是:

 cd theme

 # [Change or add some files, etc.]

 # Now commit those changes:
 git commit -a

 # Push them to the origin repository, assuming you're on the master branch:
 git push origin master

 # Change up to the parent repository:
 cd ..

 # Create a commit with the new version of that submodule:
 git add theme
 git commit -m "Committing a new version of the theme submodule"

 # Now push the commit that includes a pointer to the new submodule
 # version in the parent repository:
 git push origin master

这里的典型问题是在父存储库中推送提交,该父存储库引用了尚未从子模块版本中推送的子模块版本。您可能会发现创建一个脚本很有帮助,这样您就不会忘记这些步骤。

我只想将主题目录添加为远程目录,而不是子模块。管理文件在您自己的分支中的位置。主题的后续更新应移到适当的文件夹中

推送现在将按照您最初的预期进行

希望这能有所帮助。

你是说“回购”而不是“再回购”吗?