Question

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:

  • ../videos_nogit/...
  • bigvideo_nogit.mp4
  • assets/_nogit/bigvideos...

Thanks--

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top