A
A
Anton Morozov2020-01-02 22:49:48
git
Anton Morozov, 2020-01-02 22:49:48

How to set up .gitignore?

Hello.
Project structure:
*directory*
*file*
*file*
*file*
_____________________
Directory - folder "vendor", there are a lot of library files.
I need to open 1 folder at the 3rd level deep into the vendor'a, and close the rest for the git.
How to spell it correctly? Is there an option to close the entire vendor except for one directory inside?
Or is it necessary to write 100500 rules for all directories inside the vendor, please tell me.
I read the documentation, I see something like this:
/vendor/*
!/vendor/.../.../"open folder"
Right?
UPD. It worked like this:
/vendor/*
!/vendor/tier1/
/vendor/tier1/*
!/vendor/tier1/tier2/
/vendor/tier1/tier2/*
!/vendor/tier1/tier2/tier3/

Answer the question

In order to leave comments, you need to log in

1 answer(s)
O
O. J, 2020-01-02
@fanofmarta

True
, only you need to change the order, exceptions are described first

!/vendor/.../.../"открытая папка"
/vendor/*

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question