Search code examples
gitignore

Ignoring files with wildcard in name


I want to ignore files with a certain name but allow any version. example: I want to ignore all baz-* files without needing to point out every version. Is it possible with gitignore?

foo.jar bar.jar baz-1.0.1.jar baz-2.0.0.jar baz-2.1.0.jar


Solution

  • You can use wildcard, just add baz* to .gitignore to ignore file names start with baz.