I have this structure:
thumb/.gitignore
Inside that .gitignore
I have:
#ignore everything
*
#except gitignore
!.gitignore
I've added a file inside /thumb folder. And it appears on as untracked!
I have:
git rm -r --cached .
git add .
git commit -a -m "gitignore SHOULD work"
Repeat the process, and git stills consider the file!
What am I not getting? Could it be related to other "upper" gitignore instruction, I mean, I use this a LOT because git doesn't understand folders... (so I've been told).
Please advice.
Update:
Here are the detailed commands requested:
1 - git ls-files
git ls (git ls was a command not found. I did "git ls-files
" I hope it's the same. I didn't know any of them.)
$ git ls-files
.DS_Store
.gitignore
test
test2
thumb_5363d384b0cff.gif
2- git status .
$ git status .
# On branch dev
# Your branch is ahead of 'hub/dev' by 1 commit.
# (use "git push" to publish your local commits)
#
nothing to commit, working directory clean
3- git rm -r --cached .
$ git rm -r --cached .
rm 'public_html/assets/images/cropkimages/thumb/.DS_Store'
rm 'public_html/assets/images/cropkimages/thumb/.gitignore'
rm 'public_html/assets/images/cropkimages/thumb/test'
rm 'public_html/assets/images/cropkimages/thumb/test2'
rm 'public_html/assets/images/cropkimages/thumb/thumb_5363d384b0cff.gif'
4- git status .
$ git status .
# On branch dev
# Your branch is ahead of 'hub/dev' by 1 commit.
# (use "git push" to publish your local commits)
#
# Changes to be committed:
# (use "git reset HEAD <file>..." to unstage)
#
# deleted: .DS_Store
# deleted: .gitignore
# deleted: test
# deleted: test2
# deleted: thumb_5363d384b0cff.gif
#
#
# Untracked files:
# (use "git add <file>..." to include in what will be committed)
#
# .DS_Store
# .gitignore
# test
# test2
# thumb_5363d384b0cff.gif