我正在和node.js一起研究机器学习。对于不同的方法,有几个不同的项目,我想使用所有这些项目进行比较,因此我创建了一个父存储库machine-learning,其中包含几个(目前有两个)子模块:“感知器”和“分类器”。这两个子模块是我从其他存储库创建的分支。
现在,当我在主机器学习项目中工作时,我有时对子模块中的代码进行轻微的修改。但是当我尝试提交我的更改(到我的fork)时,它不起作用:
erelsgl@erelsgl-H61MLC:~/git/machine-learning$ git commit -a
# 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 directory)
# (commit or discard the untracked or modified content in submodules)
#
# modified: classifier (modified content, untracked content)
# modified: perceptron (untracked content)
#
no changes added to commit (use "git add" and/or "git commit -a")
erelsgl@erelsgl-H61MLC:~/git/machine-learning$ git add .
erelsgl@erelsgl-H61MLC:~/git/machine-learning$ git commit -a
# 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 directory)
# (commit or discard the untracked or modified content in submodules)
#
# modified: classifier (modified content, untracked content)
# modified: perceptron (untracked content)
#
no changes added to commit (use "git add" and/or "git commit -a")如何提交对子模块的更改?
我不确定子模块是否合适--也许有一种更好的方法可以在一个主项目中使用多个子项目,这样我就可以向每个子项目提交更改?
发布于 2013-06-12 20:20:33
您应该首先cd入子模块,并在那里提交您的更改(这基本上是一个单独的代码库)。然后,在父存储库中,您将看到该子模块已更新为新的提交,并且您将在主存储库中记录(add和commit)这一事实。
它应该看起来像这样:
# On branch master
# Changes not staged for commit:
modified: classifier (new commits)https://stackoverflow.com/questions/17063920
复制相似问题