Reputation: 1084
I am trying to add a submodule in a non empty folder inside a repo with:
git submodule add repo_path.git non_empty_folder
I get the following message:
'non_empty_folder' already exists and is not a valid git repo
Is it possible to force the creation of the submodule? Thanks!
Upvotes: 2
Views: 1201
Reputation: 45616
submodule
repo outside your main project repository.git remove
all files in the submodule directory in main projectA word of caution. I would highly suggest using a visual tool like SourceTree to help you manage submodules. It is an advanced feature of git and if not managed properly will give you plenty of grief. On a flip side, if used properly it is very powerful and can help you avoid code duplication.
Upvotes: 1