To force git to ignorirovat all the contents of a directory except one file?


Warning: count(): Parameter must be an array or an object that implements Countable in /home/styllloz/public_html/qa-theme/donut-theme/qa-donut-layer.php on line 274
0 like 0 dislike
6 views
How to force git to ignorirovat all the contents of a directory except one file?

Fundamentally a project is a file .gitignore, its contents are:

$ cat .gitignore 
/nbproject
/rt-content/users
/rt-content/places
!/rt-content/users/index.html
!/rt-content/places/index.html



You need to ignore the contents of the directories /rt-content/users and /rt-content/places, but it does not ignore files /rt-content/users/index.html and /rt-content/places/index.html inside these directories. My version is not working, what am I doing wrong, how?
by | 6 views

3 Answers

0 like 0 dislike
/nbproject
\r
/rt-content/users/*
!index.html
\r
/rt-content/places/*
!index.html
\r
Try this.
by
0 like 0 dislike
And one of the ignore rules for files that you want to ignore you, but maybe they will not have other "users" of the repository (for example, as in your case, IDE configuration files) should not be added to .gitignore and place it in either the .git/info/exclude, or in a git config setting core.excludesfile.
by
0 like 0 dislike
The people prompt how to make to ignore the file .gitignore ??
by

Related questions

0 like 0 dislike
1 answer
0 like 0 dislike
1 answer
0 like 0 dislike
3 answers
asked May 11, 2019 by Thelema
0 like 0 dislike
1 answer
110,608 questions
257,186 answers
0 comments
26,951 users