请看下面的实线,这是我最初的问题。
我的本地文件夹中有一个未被跟踪的文件夹。当我运行 git status
命令时,会得到以下结果:
Changed but not updated:
modified: vendor/plugins/open_flash_chart_2 (modified content, untracked content)
当我输入
git add vendor/plugins/open_flash_chart_2
,然后再试一次git status
时,它仍然显示未跟踪。发生了什么事?
以下是我最近半小时的简单总结:
Discovered that my Github repo is not tracking my
vendor/plugins/open_flash_chart_2
plugin. Specifically, there's no content and it's showing a green arrow on the folder icon.Tried
git submodule init
No submodule mapping found in .gitmodules for path 'vendor/plugins/open_flash_chart_2'
Tried
git submodule add git://github.com/korin/open_flash_chart_2_plugin.git vendor/plugins/open_flash_chart_2
vendor/plugins/open_flash_chart_2 already exists in the index
git status
modified: vendor/plugins/open_flash_chart_2 (untracked content)
Hunted for any file named
.gitmodules
in my repository/local directory but couldn't find one.
我该怎样才能让我的子模块正常工作,以便 git 能够正确地进行跟踪?
这可能与问题无关(我将其包含在内以防有用),但每次我键入 git commit -a
而不是我通常使用的 git commit -m "我的注释"
,它就会出现一个错误:
E325: ATTENTION
Found a swap file by the name ".git\.COMMIT-EDITMSG.swp"
dated: Thu Nov 11 19:45:05 2010
file name: c:/san/project/.git/COMMIT_EDITMSG
modified: YES
user name: San host name: San-PC
process ID: 4268
While opening file ".git\COMMIT_EDITMSG"
dated: Thu Nov 11 20:56:09 2010
NEWER than swap file!
Swap file ".git\.COMMIT_EDITMSG.swp" already exists!
[O]pen Read-Only, (E)dit anyway, (R)ecover, (D)elete it, (Q)uit, (A)bort:
Swap file ".git\.COMMIT_EDITMSG.swp" already exists!
[O]pen Read-Only, (E)dit anyway, (R)ecover, (D)elete it, (Q)uit, (A)bort:
我对Github完全不了解,尽管试图阅读文档,但这些问题仍让我感到困惑。谢谢。
git submodule add
,git submodule update --init
。 - Cascabeltracking
标签似乎用于“网站访问者跟踪”主题,所以也不适用。 - edgerunner