1

I had a couple of git submodules that were causing me problems (reference Verify changes in git modules)

I removed the submodules per http://davidwalsh.name/git-remove-submodule.

I then tried to add back the submodule, however, as seen below, am not getting the expected results (actually, they probably are expected, just not for me).

I tried the --force option but that just reverted back to my previous submodules which is not what I want. I also don't wish to change the directory of the submodule as my application uses this path.

How do I add a submodule under this scenario?

[Michael@devserver main]$ pwd
/var/www/main
[Michael@devserver main]$ git status
On branch master
Your branch is ahead of 'origin/master' by 11 commits.
  (use "git push" to publish your local commits)
nothing to commit, working directory clean
[Michael@devserver main]$ git submodule add https://github.com/parsecsv/parsecsv-for-php.git application/classes_3rd/parsecsv
A git directory for 'application/classes_3rd/parsecsv' is found locally with remote(s):
  origin        https://github.com/parsecsv/parsecsv-for-php.git
If you want to reuse this local git directory instead of cloning again from
  https://github.com/parsecsv/parsecsv-for-php.git
use the '--force' option. If the local git directory is not the correct repo
or you are unsure what this means choose another name with the '--name' option.
[Michael@devserver main]$
Community
  • 1
  • 1
user1032531
  • 24,767
  • 68
  • 217
  • 387
  • While not an answer, a workaround was to add it back locally using `--force`, and then updating them using `git submodule update --remote --merge` – user1032531 Jan 03 '15 at 22:23

0 Answers0