I know that this question has been asked many times, but honestly - in spite of many accepted answers, I've not found a neat solution to this problem. I stress the work neat here.
I want to ignore everything except one folder and its entire contents.
This will not achieve it:
*
!dest
!dest/*
that would preserve the dest
folder and all files that are in dest
, but not other folders within in as well as files in these sub-folders.
Somebody wrote in comments! to one of similar questions that you cannot achieve this without specifying full paths to what you don't want to ignore if you start your .gitignore
with *
.
I am now convinced that he was right. Or is there a neat way to ignore everything except one folder and its entire content