Alexey Murz Korepov <murznn@xxxxxxxxx> writes: > ``` > $ git add -f mysubmodule/config.yaml > fatal: Pathspec 'mysubmodule/config.yaml' is in submodule 'mysubmodule' > ``` > But I see no problems with doing this, if the file is in .gitignore of > the mysubmodule submodule. > > So, let's discuss the approach of how we can allow this in git? What should happen when mysubmodule/.gitignore changes? Who guarantees that such a file stolen by the superproject will stay in the .gitignore file in the submodule? I do not think you want to go there, and I do not think I want to see such a behaviour in Git, as we would be the ones who will be blamed for the resulting mess. The right solution probably is to keep such a file in a directory that is separate from the directory where you bind your submodule. Track the file in the superproject, and have a build procedure to copy it into the submodule directory (as an untracked file, of course).