Re: the opposite of .gitignore, whitelist
- From
Rafael Ascensão <rafa.almas@gmail.com>
- Date
- Oct 26, 2018, 13:28 UTC
- Message-ID
- <CACUQV5-t5NHwQMC0=TYZVmPT1NSQn_J+Nz+vj4jj9-b=pn9oTw@mail.gmail.com>
- In-Reply-To
- <87tvl8lw5d.fsf@evledraar.gmail.com>
One other option is to just use a pattern that matches everything, i.e:
echo '*' > .gitignoreAnd take advantage that ignore rules do not apply to tracked files. So instead of using an explicit .gitonly, you add files using: git add -f <file_to_be_included>
All files should be ignored except the ones that were forcibly added.
If needed, git ls-files can be used to list either category.
Cheers, Rafael Ascensão