如何处理git子模块中标记为“的文件夹”;“未追踪”;在主机回购中?
我有一个代码库,我想在其中添加另一个repo作为子模块来进行一些集成测试。所以,在一个教程之后,我跑了如何处理git子模块中标记为“的文件夹”;“未追踪”;在主机回购中?,git,version-control,integration-testing,git-submodules,Git,Version Control,Integration Testing,Git Submodules,我有一个代码库,我想在其中添加另一个repo作为子模块来进行一些集成测试。所以,在一个教程之后,我跑了 git submodule add -b master git@gitlab.com:kramer65/whisky.git 在这之后,git status会告诉我: $ git status On branch master Your branch is ahead of 'origin/master' by 1 commit. (use "git push" to publish y
git submodule add -b master git@gitlab.com:kramer65/whisky.git
在这之后,git status
会告诉我:
$ git status
On branch master
Your branch is ahead of 'origin/master' by 1 commit.
(use "git push" to publish your local commits)
Untracked files:
(use "git add <file>..." to include in what will be committed)
.gitmodules
whisky/
nothing added to commit but untracked files present (use "git add" to track)
$git状态
论分行行长
您的分支比“原始/主分支”早1个提交。
(使用“git push”发布本地提交)
未跟踪的文件:
(使用“git add…”包含在将提交的内容中)
.git模块
威士忌/
提交时未添加任何内容,但存在未跟踪的文件(使用“git add”跟踪)
正如您所看到的,.gitmodules
文件是新的,但是whisky/
文件夹也显示为未跟踪。在此之后,我提交了.gitmodules
文件,但whisky/
文件夹仍显示为未跟踪
我该怎么处理?我是否还需要将威士忌/
文件夹添加到“主机回购”中?或者我需要将其添加到.gitignore
?还是有其他方法来处理这个问题
欢迎所有提示 只需重新运行
git子模块add
Git将威士忌/视为子模块,不会跟踪其文件
您可以通过git diff--cached whisky/
检查它(git只会将它视为一个特定的提交)
毕竟,只要承诺就行了
加上
git加威士忌
。