Reputation: 57
First I add folder nbproject
to .gitignore
Second I used git rm --cached -r nbproject
When I use git status
I have:
`On branch newBranch
Changes to be committed: (use "git reset HEAD ..." to unstage)
modified: public/css/main.css
Untracked files: (use "git add ..." to include in what will be committed)
nbproject/private/config.properties
nbproject/private/private.properties
nbproject/private/private.xml
nbproject/project.properties
nbproject/project.xml`
And finaly when I use git add .
, everything is added
How to do it, do not add what is in gitignore
Upvotes: 0
Views: 145
Reputation: 382
As per the discussion in the comments on the question, the issue here was a back slash instead of a forward slash was used with the directory name which caused the pattern in the line of the .gitignore file to not refer to the directory as expected
Here is a link to the gitignore documentation. https://git-scm.com/docs/gitignore
Upvotes: 1