K
K
Konstantin2017-04-03 14:05:11
git
Konstantin, 2017-04-03 14:05:11

Invert ignore in .gitignore?

Good afternoon.
Please help me with the issue of inversion of ignorance.
#Ignoring
/admin/*
!admin/test.php
The inversion worked.
# Ignore everything
/admin/*
!admin/controller/module/test.php
The inversion did NOT work, why?
The task is to make everything in the admin folder ignored, including subfolders and files in subfolders except for the specified files.
Suppose:
On this path: admin/controller/module/
are test.php, test1.php, test2.php Everything
must be ignored except test.php

Answer the question

In order to leave comments, you need to log in

1 answer(s)
T
toxa82, 2017-07-16
@toxa82

/admin/* - this does not ignore everything, it only ignores everything in the specified folder. Try /admin/** - this will ignore everything regardless of nesting level.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question