Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is there a .gitnotice file?

Tags:

git

gitignore

I have a directory where I want to keep track of only a few files out of many. The .gitignore file would become unnecessarily long compared to a .gitnotice. Is it possible to tell git to ignore everything except the designated files?

like image 528
Lotramus Avatar asked Apr 07 '26 17:04

Lotramus


1 Answers

You can use the ! character to negate patterns in .gitignore. So, for example, you could ignore an entire directory other than a couple of specific files:

dir_to_ignore/*
!dir_to_ignore/file_you_want_to_track
!dir_to_ignore/another_file_you_want_to_track
like image 105
Mureinik Avatar answered Apr 10 '26 13:04

Mureinik



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!