Deprecated: Function get_magic_quotes_gpc() is deprecated in /home/styllloz/public_html/qa-include/qa-base.php on line 1175

Warning: session_start(): Cannot start session when headers already sent in /home/styllloz/public_html/qa-include/app/users.php on line 162

Warning: Cannot modify header information - headers already sent by (output started at /home/styllloz/public_html/qa-include/qa-base.php:1175) in /home/styllloz/public_html/qa-include/app/users.php on line 1267

Warning: Cannot modify header information - headers already sent by (output started at /home/styllloz/public_html/qa-include/qa-base.php:1175) in /home/styllloz/public_html/qa-include/app/page.php on line 356
To force git to ignorirovat all the contents of a directory except one file? - code-flow.club | Q&A

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
12 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 | 12 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
35,181 users