Reputation: 18819
In my .gititnore
I have an entry:
/build
Which works well- the entire directory is ignored by git. Now, I just want to make an exception to this rule and keep this file /build/outputs/mapping/release/mapping.txt
in git.
How can I do this?
Upvotes: 3
Views: 80
Reputation: 1324827
The current rule for gitignore is
It is not possible to re-include a file if a parent directory of that file is excluded.
That means:
**
'**/
'Result:
/build/**
!/build/**/
!/build/outputs/mapping/release/mapping.txt
Check what is and is not ignored with git check-ignore -v
(the -v
is important):
git check-ignore -v -- afile
Upvotes: 4