Vaibhav Agrawal
Vaibhav Agrawal

Reputation: 120

Folder uploaded as a file on GitHub

I am fairly new to GitHub and I am trying to add some files to my existing repository. I did the following steps:

  1. Pull the repo: using git clone [URL]
  2. Add the folder consisting the new files in the location created by the clone of the repo.
  3. Add the new files: git add .
  4. Commit: git commit -m " Added new Files"
  5. Push: git push

However, the problem is that my folder contains 28 files and only the folder gets pushed as a file: Here is a screenshot for the uploaded folder.

Now I can still see the files inside the CrackingTheCoding folder on my PC, but when I try to check the repo status using git status, it says that there are no more files to update.

What am I doing wrong?

Upvotes: 3

Views: 217

Answers (2)

Jeff Bowman
Jeff Bowman

Reputation: 95754

Based on the gray icon, it looks like GitHub has "CrackingTheCoding" listed as a misconfigured submodule. For comparison, see this SO question.

Git submodules are repos (or references to repos) that live inside another repo. The idea is that you may be using a library, which is tracked in its own repo with its own commits, and then the outer repo just contains an update URL and a reference to the correct hash at any given commit of the inner repo. This lets you update the library with a single git command, then check in the change as a single "file" even if it represents a lot of changed files in the inner repo.

I don't know the details here, but if CrackingTheCoding was a git repo on its own, git might have detected the inner hidden .git directory and assumed you wanted a submodule rather than one big repo.

Upvotes: 4

René Höhle
René Höhle

Reputation: 27325

I think your have committed a symlink. Git and symlinks is not a good solution. You should remove them and set them only on your system. You can check them with ls -la on that folder you should see a s for symlink.

Copy the real folder into your GIT repository.

Upvotes: 0

Related Questions