-
-
Save mikemahony/45f375ab760528f7eb2e44202ac40d7a to your computer and use it in GitHub Desktop.
Revisions
-
mikemahony revised this gist
Jul 3, 2025 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -6,7 +6,7 @@ git remote add submodule_origin git://url/to/submodule/origin git fetch submodule_origin # Start a fake merge (won't change any files, won't commit anything) git merge -s ours --no-commit --allow-unrelated-histories submodule_origin/master # Do the same as in the first solution git rm --cached submodule_path # delete reference to submodule HEAD -
Ryan Muller created this gist
May 5, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,21 @@ From [Stack Overflow](http://stackoverflow.com/questions/1759587/un-submodule-a-git-submodule). ```shell # Fetch the submodule commits into the main repository git remote add submodule_origin git://url/to/submodule/origin git fetch submodule_origin # Start a fake merge (won't change any files, won't commit anything) git merge -s ours --no-commit submodule_origin/master # Do the same as in the first solution git rm --cached submodule_path # delete reference to submodule HEAD git rm .gitmodules # if you have more than one submodules, # you need to edit this file instead of deleting! rm -rf submodule_path/.git # make sure you have backup!! git add submodule_path # will add files instead of commit reference # Commit and cleanup git commit -m "removed submodule" git remote rm submodule_origin ```