Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GitHub keeps throwing "Could not commit submodules" error, and I don't see why that is. Any ideas?

I'm trying to put my project on GitHub, but I keep running into an issue. I made a repo on GitHub (the website), downloaded the client, cloned (dragged and dropped the link GitHub gave me basically) it in, moved my project in the clone directory, and I still didn't see the files. So I checked under "Changes", and found my project files. Now it's saying "Could not commit submodules". How do I fix this?

Here's a screenshot if anyone needs it:

Error

Due to being too long here is the log in its entirety.

like image 302
KernelPanic Avatar asked Nov 16 '15 03:11

KernelPanic


2 Answers

If your project was itself a git repo (meaning it has a .git), the presence of the .git could confuse the GitHub Desktop client.
It could be seen as a nested git repo (for which only the gitlink is recorded), and the GUI tries to see it as a submodule.

Try with command line (unzip PortableGit-2.6.3-64-bit.7z.exe anywhere you want and add it to your %PATH%)

cd /your/project
git remote add origin https://github.com/<username>/<yourrepo>
git push

Then reference that same project directory in GitHub Desktop: it will be recognized as a local repo linked to a GitHub one.


Update 2018, as mentioned by t3chb0t in the comments:

The new client desktop.github.com doesn't have this problem anymore.

like image 191
VonC Avatar answered Nov 15 '22 09:11

VonC


For me, it was because the mentioned folder was a symlink in Windows.

src folder is symlink in windows

GitHub not allowing symlink to commit

like image 20
David Refoua Avatar answered Nov 15 '22 10:11

David Refoua