6

I am quite new to github. I worked on a project which has multiple folders. Now when I try to push the local repo to github, only the files in the root are getting pushed (Not the files inside folders).

I am following these commands

git add .
git commit -m "message"
git push -u origin master

Can someone point out the actual commands

EDIT: Sample Folder Structure

root
/Folder1/File1.txt
/Folder1/File2.txt
/Folder1/File3.txt
/Folder1/SubFolder1/File.txt
/Folder2/File1.txt
/Folder2/File2.txt
/Folder2/File3.txt
/Folder3/SubFolder1/File.txt
/README
/index.php
4
  • 3
    That is not possible since you are using git add .. Give sample folder structure and output of git status
    – manojlds
    Jan 6, 2012 at 5:55
  • 1
    Can you add the output of git status before and after you run the git add, like this... git status git add . git status ? Jan 6, 2012 at 6:01
  • Also to add to the other guys - does git push give an error? Jan 6, 2012 at 6:10
  • Does the result of commit show the files inside the sub directories?
    – rjv
    Jan 6, 2012 at 8:57

2 Answers 2

9

Try using git add -A. This should add everything including those files that are untracked.

0
-1

delete the old .git then do git init then git add -A if this didnt work check .gitignore by doing git status --ignore

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.