Yarin
Yarin

Reputation: 183499

Creating directory/file name rules for .gitignore

I'd like to set up some rules in my .gitignore whereby any directory or file with a name containing "_nogit" will be ignored.

Examples:

Thanks--

Upvotes: 1

Views: 4010

Answers (1)

CanSpice
CanSpice

Reputation: 35788

If you have a line in your .gitignore file that does not have slashes in it, then git treats it like a shell glob pattern. Thus, adding *_nogit* to your .gitignore will ignore all of those files.

See also the gitignore man page.

Upvotes: 4

Related Questions