1

My git repo is stating that it is clean, when checked from the commandline:

$ git status
On branch develop
Your branch is up-to-date with 'origin/develop'.

nothing to commit, working directory clean

But GitHub for mac is showing that a submodule needs to be added:

GitHub spazzing out

I prefer to use GitHub, but can't really proceed as the submodule is causing an issue as I can't seem to add it. Has anyone else ever come across this? How do I get them to both agree (as it's the same Git repo!)

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
a1phanumeric
  • 814
  • 2
  • 12
  • 29
  • 1
    Did you try a `git submodule update --init` first, and then check the status in your GitHub for Mac? – VonC Aug 11 '14 at 15:08
  • Tried that - didn't work :(. I have simply removed the submodule declaration within .gitmodules for now (to work around this issue). – a1phanumeric Aug 11 '14 at 15:16

2 Answers2

1

Check your .git/config file and make sure the submodule is listed there. Add it if not. Ex:

[submodule "yoursubmodule"] url = git@github.com:[your repo]

Then do a git pull. It may be that there is no 'reference' to the submodule in the root project, so it is not able to find it.

inquiring minds
  • 1,785
  • 2
  • 15
  • 16
  • Haha that was it! No idea how that got messed up! However, I re-added it, pulled it and all the code was new (for this submodule) which funked everything up. I think I'll remove ALL submodules and just keep static copies as I know they won't change... Thanks! – a1phanumeric Aug 11 '14 at 15:21
1

If the submodule doesn't work, you would not only need to remove it from the .gitmodules file, but you would also need to remove it from the index:

git rm --cached assets/chosen

(no trailing '/')

That is because a submodule is a special entry (gitlink) in the index (to record the SHA1 associated with said submodule).

Community
  • 1
  • 1
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250