Ryan Glenn
Ryan Glenn

Reputation: 1416

Gitignore folder name with wildcard

How can I gitignore a folder with a name like this: myfolder*.pizza

So the idea is that anything starting with myfolder, with anything in between as long as it ends with .pizza would be ignored.

Upvotes: 1

Views: 328

Answers (1)

VonC
VonC

Reputation: 1324278

If a myfolder*.pizza/ rule does not work, that should only mean the files in such a folder are already tracked.

In that case:

cd /path/to/repo
find . -name "myfolder*.pizza" -type d -exec git rm -r --cached {} ;

Upvotes: 1

Related Questions