coure2011
coure2011

Reputation: 42444

ignore multiple folders in same root

I stumble upon this rule in .gitignore file

src/ms.net/CrmPackageAll/*.suo[!!-~]*.user[!!-~]bin[!!-~]obj

looks like which means to ignore

-- files ending with .suo and .user
-- folders bin and obj

but when I typed git status, it still show me bin and obj folders in untracked files, whats [!!-~]? not able to find any documentation for that and how I can ignore bin and obj folder in single rule?

Upvotes: 2

Views: 1220

Answers (1)

VonC
VonC

Reputation: 1324537

I don't see that format in gitignore man page.

If you need to ignore:

  • files ending with .suo and .user
  • folders bin and obj

Your .gitignore would be:

*.suo
*.user
bin/
obj/

If a git status still shows those files/folders, that means they were tracked.
You would need to remove them first:

For instance:

git rm --cached -r bin/
git commit -m "remove bin"

Then the git status would not list that bin/ folder anymore.

Upvotes: 2

Related Questions