Derek Carlisle
Derek Carlisle

Reputation: 485

Git Error: "is in submodule"

I'm using gitflow on my website, however I downloaded a 3rd party library using Git and I can't add this to my main repo. If I try to I get the following message:

fatal: Path 'FILENAME' is in submodule 'SUBMODULE_NAME'

If I run cat .git/config I get:

[core]
    repositoryformatversion = 0
    filemode = true
    bare = false
    logallrefupdates = true
[gitflow "branch"]
    master = master
    develop = develop
[gitflow "prefix"]
    feature = feature/
    release = release/
    hotfix = hotfix/
    support = support/
    versiontag = 
[remote "origin"]
    url = [email protected]/xxxx.git
    fetch = +refs/heads/*:refs/remotes/origin/*`

If I do find . -name ".git*"

./libs/3RD_PARTY_NAME/.git

./libs/3RD_PARTY_NAME/.gitignore

./.git

./.gitignore

git status says:

# On branch develop
nothing to commit (working directory clean)

If you need any more information please let me know.

Thanks

Upvotes: 2

Views: 1245

Answers (1)

Peter van der Does
Peter van der Does

Reputation: 14468

To add a 3rd party as a submodule:

git submodule add git@mygithost:3RD_PARTY_NAME libs/3RD_PARTY_NAME

A good read on submodules http://chrisjean.com/2009/04/20/git-submodules-adding-using-removing-and-updating/

I in general try to avoid submodules, their a pain in the behind. :)

Upvotes: 2

Related Questions