Git believes some copied code is a submodule

To debug the problem in a third-party library, I copied their source code into my own git repository. I immediately reproduced the problem, so I wanted to record the starting point. When I tried to commit, none of the files that I copied appeared in my working tree, so I could not generate them.

I tried to explicitly place one of the files in the copied source:

git add README 
fatal: Path 'Src/Foo/README' is in submodule 'Src/Foo/FooBar'

So it seems that git thinks this is a submodule, although I never said that it was. I tried to remove the .git directory in the root directory of a third-party source, but that did not help. Then I tried to follow these instructions , but he tells me that I do not have submodules:

git submodule deinit .
No submodule mapping found in .gitmodules for path 'Src/Foo/FooBar'

Any ideas?

+4
source share
1 answer

The simplest solution is to clone a third-party repo, play your fix, commit and click (if you have access to their repo, if you forked it on GitHub )

If not, do (in the new clone of your repo) a:

git ls-tree HEAD Src/Foo/FooBar

See if there is a special entry160000 that indicates that FooBar was registered as a submodule at one time), even if .gitmodules doesn't list FooBar anymore.

A git rm --cached Src/Foo/FooBar(with git 1.8.5+) will take care of writing the submodule.


, git, .
.

+5

Source: https://habr.com/ru/post/1530711/


All Articles