I have a very basic github setup with a readme, a directory, and another directory inside it with an html file. On github I can only view the readme and the first folder but
I kept receiving the same message no matter what i did.
To fix this, i removed .gitignore and i am not getting the Github changes not staged for commit message anymore. Before it would allow me to commit once when i ran git add . and then after it would bring up the same message.
Im not sure why the .gitignore file was causing a problem but i added on my local machine and most likely didn't sync it up properly.
If it's a submodule you need to cd into it then use git add . && git commit -m 'Your message'
From there you can cd out and push to whichever branch you want.
Have you tried
git add .
This recurses into sub-directories, whereas I don't think * does.
See here
In my case the problem was the subfolder that I was tying to push was a git folder itself
So I did the following
rm -rf .git
git rm --cached <subfolderName>
git add <folderName>/
git commit -m "Commit message"
git push -f origin <branchName>
WARNING! THIS WILL DELETE THE ENTIRE GIT HISTORY FOR YOUR SUBMODULE. ONLY DO THIS IF YOU CREATED THE SUBMODULE BY ACCIDENT. CERTAINLY NOT WHAT YOU WANT TO DO IN MOST CASES.
In my situation, there was a sub-directory which had a .git
directory.
What I do is simply remove that .git
directory from my sub-directory.
This command may solve the problem :
git add -A
All the files and subdirectories will be added to be tracked.
Hope it helps