Reputation: 71
I'm trying to figure out a rule for .gitignore
file to only keep track of my dotfiles.
I've tried combinations of !.*
and !^.*
used after *
and also [^.]*
as advised here. None of those ignored all of the visible, non dotfiles. What am I missing?
Upvotes: 4
Views: 1284
Reputation: 3069
*
ignores everything!.*
except dot files!.*/**
except any files inside dot files*
!.*
!.*/**
Upvotes: 2
Reputation: 94676
Try
*
!/**/
!.*
Ignore everything, unignore all directories, unignore dotfiles.
Upvotes: 2