I'm having trouble ignoring specific files and directories in Git using the .gitignore file. I want to exclude the following files and directories from my repository:
# Visual Studio Code
.vscode/*
!.vscode/settings.json
!.vscode/tasks.json
!.vscode/launch.json
!.vscode/extensions.json
.history/*
I've placed this .gitignore file in the root directory of my Git repository, but the specified files and directories are still being tracked and uploaded to the repository. I've also tried removing the files from the Git cache and recommitting, but it didn't solve the issue.
I've checked the file paths and made sure they are correct. There are no conflicting rules in global or local ignore files, and the repository status doesn't show any staged files.
Can anyone help me understand why these files and directories are not being ignored by Git and suggest a solution to properly exclude them from my repository?