Version-Control-Git-Teaching-Notes

The Order of Rules

Given a .gitignore file with the following contents:

*.dat
!*.dat

What will be the result?

Solution

The ! modifier will negate an entry from a previously defined ignore pattern. Because the !*.dat entry negates all of the previous .dat files in the .gitignore, none of them will be ignored, and all .dat files will be tracked.

Episode 6 Exercise 6