可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
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:

Due to being too long here is the log in its entirety.
回答1:
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.
回答2:
For me, it was because the mentioned folder was a symlink in Windows.


回答3:
I encountered this error for a different reason.
Being a novice programmer, I had used Github Desktop to accidentally create a repo within my repo.

I just had to delete this folder.
回答4:
What worked simplest for me when I had the same issue was to just delete the duplicates of the .git files and .git folder.
The main project parent folder should have 2 files (.git and .gitignore) + a folder called .git (it may be a hidden folder)
I had these files duplicated in the next subfolder, which confused Github Desktop. So I just deleted all the duplicated instances of these files that were in the subfolder(s).