1

I got the solution to my problem here https://stackoverflow.com/a/23087593/5253746

But, I want to know why the problem occurs. I added image files to .gitignore. Then, I made some new folders with code and images. I decided to remove the image files from .gitignore.

From a sub-folder in my repository, I did git add ., git commit -m "message", git push which were successful. When I did git status I see the same git status before the commit/push.

Why does this happen ?

Community
  • 1
  • 1
HelloWorldNoMore
  • 307
  • 3
  • 14
  • What is that status? Does it show any of the files in that subfolder, as modified or otherwise? Can you include the output of `git status` for that directory into your question? –  Nov 24 '15 at 05:37
  • Well what did `git status` show you right before the commit? It sounds like the `git add .` did not work, possibly owing to the `.gitignore` file or something else. – Tim Biegeleisen Nov 24 '15 at 05:37
  • 1
    When you say 'git push was successful', what do you mean? Can you share output of 'git add .', 'git commit -m "message"' and 'git push' commands? – Prasanna Nov 24 '15 at 05:37
  • `.` refers to the current folder and it's subdirectories, that's why it doesn't work. – 1615903 Nov 24 '15 at 06:40

1 Answers1

0
git add .

means add '.' folder to the staging area. since you are in a subdirectory, it won't work.

You could try git add ../ from the sub-directory to add all files from the parent directory. Checkout 'pathspec' from options from this page

Harish Ved
  • 560
  • 4
  • 17