Negative patterns in cone mode
- From
- Brown, Chris <chris.c.brown@siemens.com>
- Date
- Apr 4, 2023, 12:00 UTC
- Message-ID
- <GVXPR10MB8199D186532A7A285CCF1538B9939@GVXPR10MB8199.EURPRD10.PROD.OUTLOOK.COM>
Hi all,
I'm facing an issue with negative patterns in cone mode. I can't tell from the docs or git code if I misunderstand the usage, am trying something not supported, or if there is a bug.
What I want to do is exclude a small number of directories (and their subdirectories) from a large repo, without explicitly declaring all the other directories that I wish to keep.
My directory structure is: root ^----A ^----B ^----C
My sparse-checkout file is: /* !/A/B/
I've set up an MRE: 1. git clone --sparse https://github.com/peakschris/sparse.git 2. cd sparse 3. copy sparse-checkout.txt .git\info\sparse-checkout 4. git sparse-checkout reapply
Output: git sparse-checkout reapply warning: unrecognized negative pattern: '/A/B' warning: disabling cone pattern matching warning: unrecognized negative pattern: '/A/B' warning: disabling cone pattern matching
Thanks! Chris