Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

No submodule mapping found in .gitmodules for path

When I run

git submodule update No submodule mapping found in .gitmodules for path 'Classes/lib/AFKissXMLRequestOperation' 

But I have no submodule Classes/lib/AFKissXMLRequestOperation in current repos

My git config is:

[core]     repositoryformatversion = 0     filemode = true     bare = false     logallrefupdates = true     ignorecase = true     precomposeunicode = false [remote "origin"]     fetch = +refs/heads/*:refs/remotes/origin/*     url = [email protected]:why_ios.git [branch "master"]     remote = origin     merge = refs/heads/master [submodule "External/ios-SDNestedTable"]     url = [email protected]:why/ios-SDNestedTable.git [submodule "External/PSStackedView"]     url = [email protected]:why/PSStackedView.git 

and .gitmodules is:

[submodule "External/ios-SDNestedTable"]     path = External/ios-SDNestedTable     url = [email protected]:why/ios-SDNestedTable.git [submodule "External/PSStackedView"]     path = External/PSStackedView     url = [email protected]:why/PSStackedView.git 
like image 958
why Avatar asked Feb 06 '13 01:02

why


People also ask

How do I add a submodule to a specific path?

In order to add a Git submodule, use the “git submodule add” command and specify the URL of the Git remote repository to be included as a submodule. When adding a Git submodule, your submodule will be staged. As a consequence, you will need to commit your submodule by using the “git commit” command.

Where do I find the .gitmodules file?

The . gitmodules file, located in the top-level directory of a Git working tree, is a text file with a syntax matching the requirements of git-config[1]. The file contains one subsection per submodule, and the subsection value is the name of the submodule.

What is submodule path?

Submodules are Git repositories nested inside a parent Git repository at a specific path in the parent repository's working directory. A submodule can be located anywhere in a parent Git repository's working directory and is configured via a . gitmodules file located at the root of the parent repository.


2 Answers

check that you have the proper setting in .git/modules as well. Since a few versions ago, git adds an entry there.

Also, the tree probably has a commit object at that path. To get rid of it you can

git rm --cached Classes/lib/AFKissXMLRequestOperation 

that should get rid of it once and for all.

like image 103
Adam Dymitruk Avatar answered Sep 19 '22 08:09

Adam Dymitruk


Just leaving this here for anyone using git on Windows. It is possible to follow all of the answers online and still have it not work due to git's handling of path separators. E.g.:

My problem case was adding hugo themes via submodule:

git submodule add https://github.com/danielkvist/hugo-terrassa-theme.git themes\terrassa

will result in a .gitmodules like:

[submodule "themes\\terrassa"]     path = themes\\terrassa     url = https://github.com/danielkvist/hugo-terrassa-theme.git 

Which will cause problems for git submodule [status || init || ...]

Manually replacing the separators to:

[submodule "themes/terrassa"]     path = themes/terrassa     url = https://github.com/danielkvist/hugo-terrassa-theme.git 

...solved it for me.

Also solved the deployment on Netlify since they use *nix server images.

like image 45
tykom Avatar answered Sep 19 '22 08:09

tykom