GitHub continues to throw a “Could not commit subodules” error, and I don’t understand why this is. Any ideas?

I'm trying to put my project on GitHub, but I have a problem all the time. I made a repo on GitHub (website), downloaded the client, cloned (dragged and removed the link that GitHub gave me mostly), it moved my project to the cloning directory, and I still have not seen the files. So I checked in the "Changes" section and found the project files. Now he says: "Failed to fix submodules." How to fix it?

Here is a screenshot if he needs it:

Error

Due to too much time here the magazine is complete .

+6
source share
4 answers

If your project itself had a git repo (which means it has .git), having .git can confuse the GitHub Desktop client.
This can be seen as a nested git repository (for which only the gitlink entry is written) , and the GUI tries to see it as a submodule.

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

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

Then specify the same project directory in GitHub Desktop: it will be recognized as a local repo associated with GitHub.


Update 2018, as indicated by t3chb0t in the comments :

The new desktop.github.com client no longer has this problem.

+8
source

I encountered this error for another reason.

As a newbie programmer, I used Github Desktop to randomly create repos in my repo.

rookie mistake

I just had to delete this folder.

0
source

For me, this is because the specified folder was symlink on Windows.

src folder symbolic link in windows

GitHub does not allow symbolic commit

0
source

Which worked easier for me when I had the same problem, just delete duplicate .git and .git files.

The main parent folder of the project should contain 2 files (.git and .gitignore) + a folder named .git (this can be a hidden folder)

I duplicated these files in the next subfolder, which confused Github Desktop. So I just deleted all duplicated instances of these files that were in subfolders.

0
source

All Articles