1

I have some large legacy git repository which I divided into modules. My problem is when I try to apply a patch created when we don't use submodule super-project doesn't have the track of submodule files.

Here my steps:

$ git clone [email protected]:super-project $ cd super-project $ git clone [email protected]:my_submodule $ git submodule add ./my_submodule $ git submodule init $ git submodule sync $ git submodule update $ git add .gitmodules $ git commit -a $ git am ~/patches/* Applying: <PATCH NAME> error: <PATH TO FILENAME>: does not exist in index When you have resolved this problem run "git am --resolved". If you would prefer to skip this patch, instead run "git am --skip". To restore the original branch and stop patching run "git am --abort". 

2 Answers 2

1

I think you need to apply the patches only within the submodules. If you split the project in such a way that some individual patch files now refer to multiple submodules, then you may need to edit the patch files (possibly by writing a script if there are many). Or you could try applying the patch files in a "sloppy" way using the patch program rather than git and ignoring the partial failures which will occur depending on which submodule has which target files.

Sign up to request clarification or add additional context in comments.

Comments

1

Take a look at git-slave to coordinate work that transcends Submodules.

otherwise, just

git submodule add url path/you/want git submodule update --init --recursive git add -A git commit -m "added submodule" 

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.