2

I am using a plugin that helped me tremendously but uses a submodule. When I tried to push it to remote I learned that a submodule is just a reference to another repo. I want to just have the files in my own repo and push them to remote.

All attempts from other SO articles have failed so far.

Here is my .submodules folder:

[submodule "Vendor/Opauth"]
    path = Vendor/Opauth
    url = git://github.com/opauth/opauth.git

Here is my filesystem for this specific area: enter image description here

How do I remove the submodule and then keep the Vendor/Opauth files?

itamar
  • 3,837
  • 5
  • 35
  • 60

1 Answers1

4

As I mentioned in "How do I remove a Git submodule?", you should deinit and remove the submodule (assuming here git 1.8.3+).

git submodule deinit Vendor/Opauth
git rm --cached Vendor/Opauth
rm -Rf .git/modules/Opauth

The --cached ensure that you keep the files on the disk.

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Thanks I saw your post earlier - problem is I get this: `error: pathspec 'app/Plugin/Vendor/Opauth' did not match any file(s) known to git. Did you forget to 'git add'?` – itamar Mar 07 '15 at 19:45
  • @itamar but if the submodule path is `Vendor/Opauth`, shouldn't the `git rm` uses `Vendor/Opauth` from the `Plugin` folder? – VonC Mar 07 '15 at 19:49