Greetings,
I have a weird problem with Git and using .gitignore. I have a folder (that has contents) in my structure that is currently not getting tracked by git because it shows up under the Untracked files when I do git status. I add it's path to .gitignore but try git status again and it is still there! Other files/folders, I do the same thing and they disappear, but not this folder. What am I doing wrong?
Update
The folder structure is:
folder_foo/folder_bar/folder_baz/file_foo
folder_foo/folder_bar/folder_baz/file_bar
folder_foo/folder_bar/.htaccess
My .gitignore
is:
folder_foo/folder_bar
!folder_foo/folder_bar/.htaccess
When I run git status
is says that the folder folder_foo/folder_bar/
is untracked.
I've figured out now that if I remove the second line from the .gitignore
then it works fine. So I've come up with this as a fix:
folder_foo/folder_bar
!.htaccess
Why is it that I have to do it that way and not specify the exact .htaccess
file?