8/31/2023 0 Comments Add a git submodule![]() gitmodules file is trying to add files into a repo’s submodule. The Git developers’s intentions are clear: a repo is not supposed to add files into its submodules, and your example. The code for git add unconditionally calls die_path_inside_submodule() which is the function that gives you the “fatal: Pathspec 'Source/V8/build/gyp' is in submodule 'Source/V8'” error. In other words, in order to configure_added_submodules, Git needs to run git add with some arguments. We will update this new repository using a submodule. Struct child_process add_submod = CHILD_PROCESS_INIT ĭie(_("Failed to add submodule '%s'"), add_data->sm_path) The git submodule add command allows us to add a fresh submodule to an already-existing repository. Im on git version 2.7.4 and when I do: git submodule add. In my specific case, I had git cloned an extension and ran git add. git directory because you wanted to add directory to your main git project. ![]() Update: Note this question is about creating a submodule structure, not initializing it.īased on my analysis of the Git v2.40.1 source code, it appears that what you’re trying to do is impossible.īuiltin/submodule-helper.c contains the code that produces that “Failed to add submodule 'Source/V8/build/gyp'” error you got: static void configure_added_submodule(struct add_data *add_data) Following this answer on SO- I understand that following git 1.8.4, submodules can be added from anywhere ( not just toplevel). Removing the directory from git and adding it again worked for me: git rm -cached directory git add directory This works if you purposefully removed the. Please let me now if this case is possible to achieve. This means that if you pull in new changes into the. Resolving deltas: 100% (10452/10452), done.įatal: Pathspec 'Source/V8/build/gyp' is in submodule 'Source/V8'įailed to add submodule 'Source/V8/build/gyp' Use the git submodule update command to set the submodules to the commit specified by the main repository. Now we will add the child repos upstream to the main repo. git clone :main/main.git git submodule deinit child git rm child git add -all git commit -m 'remove child submodule'. Remote: Total 16486 (delta 10444), reused 16486 (delta 10444) Start by cloning the parent repo and removing the old submodule. It is one of several ways Git projects can manage project dependencies. Using git submodule add -f results in: Cloning into 'Source/V8/build/gyp'. git subtree lets you nest one repository inside another as a sub-directory. Results in: The following path is ignored by one of your. I tried the following example with no success: git submodule add Note that the path of the submodules are nested: This question is about the possibility of nesting a submodule within a submodule: The author assumed a git submodule hierarchy like this: Is it possible for a git submodule to be made of several other git submodules, and the super git repo to fetch the contents for each submodule?
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |