3

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?

jub0bs
  • 60,866
  • 25
  • 183
  • 186
Vaibhav Agrawal
  • 120
  • 1
  • 10
  • Advice to all: 1) Use git status and then git add file1,file2,... and 2) use git commit and then put the message in the editor - you'll have space for better message and you'll get to review the file list to be sure. These steps will help you better understand what is going on which is essential when you run into issues. – Michael Durrant Aug 25 '15 at 18:28

2 Answers2

4

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.

Community
  • 1
  • 1
Jeff Bowman
  • 90,959
  • 16
  • 217
  • 251
0

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.

René Höhle
  • 26,716
  • 22
  • 73
  • 82
  • It isn't a symlink. I copied the original folder while pushing it. It looks like what Jeff has suggested and I am trying to work upon his suggestion. – Vaibhav Agrawal Aug 25 '15 at 18:25