git/list[1] front-page[2] threads[3] people[4] search[5] about
 

git sparse checkout exclusions not working?

From
Sskillzero@gmail.com <skillzero@gmail.com>
Date
Apr 27, 2011, 16:35 UTC
Message-ID
<BANLkTinPg_jaxiF8yFtnf4BrT4fx-BQ=+A@mail.gmail.com>

It seems like ! patterns in the sparse-checkout file don't exclude individual files in a directory. Here's what I did:

git init mkdir test1 echo "test1" test1/file1.txt echo "test2" test1/file2.txt echo "test3" test1/file3.txt mkdir test2 echo "test2" test2/file1.txt echo "test2" test2/file2.txt echo "test2" test2/file3.txt git add . git commit -m "test" git config core.sparseCheckout true

echo 'test1/' > .git/info/sparse-checkout echo '!test1/file2.txt' >> .git/info/sparse-checkout git checkout master --

The end result is like this:

test1 test1/file1.txt test1/file2.txt test1/file3.txt

The "test1" directory was included, but "test1/file2.txt" wasn't excluded even though I added a ! pattern for it. The test2 directory was correctly excluded so that makes me think sparse was working in general, but just not respecting the ! pattern in this case.

Is this a bug or am I doing something wrong?
Next: Nguyen Thai Ngoc Duy
Message 1 of 3 in “git sparse checkout exclusions not working?”
  1. skillzero@gmail.comApr 27, 2011
  2. Nguyen Thai Ngoc DuyApr 29, 2011
  3. Nguyen Thai Ngoc DuyApr 30, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.