如何删除Git子模块?
顺便说一句,有什么理由我不能干脆做到
git submodule rm whatever吗?
我正在尝试将一个分支添加到GitHub上的主分支,并将一个文件夹推送到该分支.
分支的文件夹结构如下 - SocialApp/SourceCode/DevTrunk/SocialApp,所有源代码文件都在最后一个文件夹中.
我使用以下Git命令:
git add *
git commit -m with the message
git push
Run Code Online (Sandbox Code Playgroud)
这只是将第一个文件夹"SocialApp"推送到GitHub并忽略文件夹内的文件夹SourceCode.我该如何解决?
请参阅下面的原始问题的实线.
我的本地目录中有一个未跟踪的文件夹.当我跑步时git status,我得到:
Changed but not updated:
modified: vendor/plugins/open_flash_chart_2 (modified content, untracked content)
Run Code Online (Sandbox Code Playgroud)
当我输入git add vendor/plugins/open_flash_chart_2然后再试git status一次时,它仍然没有说明.这是怎么回事?
以下是我最近半小时的简单摘要:
发现我的Github仓库没有跟踪我的vendor/plugins/open_flash_chart_2插件.具体来说,没有内容,它在文件夹图标上显示绿色箭头.
试着 git submodule init
No submodule mapping found in .gitmodules for path 'vendor/plugins/open_flash_chart_2'
Run Code Online (Sandbox Code Playgroud)试着 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
Run Code Online (Sandbox Code Playgroud)git status
modified: vendor/plugins/open_flash_chart_2 (untracked content)
Run Code Online (Sandbox Code Playgroud).gitmodules在我的存储库/本地目录中命名的任何文件都被搜索但找不到.
我需要做些什么才能使我的子模块正常工作,以便git可以正常开始跟踪?
这可能是无关的(我把它包括在它有帮助的情况下),但每次我输入git commit -a而不是我平时git commit -m "my comments",它会抛出一个错误:
E325: ATTENTION
Found a …Run Code Online (Sandbox Code Playgroud) 如何将现有的子存储库添加为 git 中的子模块?
我有一个私人codespace超级模块,其子模块随机分散:
codespace (git repo, private)
??? Archived_projects (git repos)
??? Projects
??? project-foo (git repo)
??? project-bar (git repo)
Run Code Online (Sandbox Code Playgroud)
有时子模块有未准备好推送的提交。但我希望在推送 supermodule 时保存它们codespace。
codespace是克隆到c9.io工作区或其他地方的 repo 。
codespace (git repo, private)
??? Archived_projects (git repos)
??? Projects
??? project-foo (git repo)
??? project-bar (git repo)
Run Code Online (Sandbox Code Playgroud)
从cmd.exe
linus@machine /cygdrive/f/__Storage__/Workspace
$ git clone https://github.com/octocat/Spoon-Knife.git
Cloning into 'Spoon-Knife'...
$ cd Spoon-Knife/
$ git clone https://github.com/octocat/Spoon-Knife.git ./foo/bar
Cloning into './foo/bar'...
$ git …Run Code Online (Sandbox Code Playgroud)