A working copy of version controlled code which doesn't include the whole repository.
Questions tagged [sparse-checkout]
124 questions
2
votes
1 answer
Git pull contents of a folder from a repository
I have been trying this with no success.
I have a git repository that contains 3 folders. Lets say:
Folder A
Folder B
Folder C
I want to be able to pull just the contents of folder B to a webserver for example.
I just want to somehow init a git repo…

Marius Ilie
- 220
- 2
- 13
2
votes
1 answer
Tortoise SVN: Creating a Sparse Branch
Below is a link with instructions on how to create a branch using Tortoise SVN.
How do I create a new branch using TortoiseSVN?
I'm using the Sencha ExtJS and Sencha Touch frameworks for my development. Sencha recommends that developers structure…

JustBeingHelpful
- 18,332
- 38
- 160
- 245
1
vote
1 answer
git sparse checkout unable to switch branches
I have a two branches main and feature branch. In both the branches there are two folders f1 and f2. There is a file inside f1 folder called file1.txt.
main branch structure
-root
- f1
- file1.txt
- f2
feature branch structure
-root
- f1
…

PforPython
- 58
- 7
1
vote
1 answer
How do I delete a mistakenly-migrated .git directory from the tree of a Git repository?
Several months ago, we migrated a bunch of Subversion repositories to Git using svn-all-fast-export. (That information explains how this directory got in the Git directory in the first place, but probably isn't pertinent to removing it.) Today, one…

Nick Williams
- 2,864
- 5
- 29
- 43
1
vote
0 answers
git sparse checkout warning: unrecognized negative pattern
I have clone the full repo before. so I run the following command.
cd main
git sparse-checkout init --cone
echo -e '/*\n!/client/*' > .git/info/sparse-checkout
git checkout
then the output
warning: unrecognized negative pattern:…

ningyuwhut
- 609
- 12
- 27
1
vote
0 answers
how to clone specific folder from git using --sparse
git version 2.25.1
I'm trying to clone only a specific directory from the git repository using the below command ;
git clone --depth 1 --filter=blob:none --sparse https://github.com/gitexpert/testGithub.git
cd testGithub
git sparse-checkout set…

itgeek
- 549
- 1
- 15
- 33
1
vote
1 answer
Sparse checkout but exclude or ignore files in root?
The docs for git sparse-checkout state,
By default, when running git sparse-checkout init, the root directory is added as a parent pattern. At this point, the sparse-checkout file contains the following patterns:
/*
!/*/
However, I do not want to…

Evan Carroll
- 78,363
- 46
- 261
- 468
1
vote
2 answers
Jenkins git checkout - place .git folder in another place
We make a deploy to client's folder at client's server using Jenkins via VPN of several git repos. I've set the "Check out to a sub-directory option" and "Sparse checkout".
We need to deploy only some files of one common repository (other files are…

Mikhail V.
- 75
- 8
1
vote
1 answer
Sparse checkout leaves no entry on working directory
I was trying to use Sparse checkout option to reduce the size of checkout in my Jenkins Pipeline.
It worked for some time and then when I did small modifications to the script (not in the checkout section), I started getting this error
pipeline {
…

Arpit
- 79
- 8
1
vote
1 answer
git sparse-checkout of a submodule from a root repo
I have a main repo with 4 submodules:
kvm
libvmi
qemu
nitro
and I would like to sparse-checkout kvm, to filter out a few annoying files that are not comptabile with filesystem limitations on Windows
(AUX is a reserved filename, and kvm tree…

Wenzel
- 147
- 1
- 14
1
vote
1 answer
Use git sparse checkout to workaround file name with colon
When I clone a repository on Windows, it complains about a file name with colon, so checkout fails. I want to use sparse checkout to exclude the whole directory, but it doesn't work. Is sparse checkout the correct way to help here?
My steps:
git…

codewarrior
- 723
- 7
- 22
1
vote
1 answer
Sparse checkout for a specific file on empty repo
I have two repos: ci-test and ci-test2. The ci-test repo contains a CI.yaml file and the ci-test2 repo is empty. Using mgit, I am performing a sparse checkout of only the CI.yaml file on both repos and I get the error, "Sparse checkout leaves no…

Stef Man
- 65
- 8
1
vote
2 answers
git sparse checkout with multiple repositories
I am wanting to create a project that borrows from two repositories, sparsely checked out. However the format of "${GIT_REPO}/info/sparse-checkout" only references a path, not a tree-ish or repo centric path. Hence I cannot seem to reference a…

rupert160
- 1,441
- 1
- 17
- 19
1
vote
3 answers
Git sparse checkout error "Entry 'path/to/file' not update. Cannot update sparse checkout"
I've just done a sparse checkout following the steps below
git clone http://location/repo.git
# create .git/info/sparse-checkout file
git config --bool core.sparsecheckout true
git read-tree -mu HEAD
Unfortunately the final step fails with the…

Olumide
- 5,397
- 10
- 55
- 104
1
vote
0 answers
After doing an SVN ( subversion ) sparse checkout how can I checkout more files
Say I have a repository as such
- trunk
- dir0
- a.txt
- b.txt
- dir1
- c.txt
- d.txt
then I do a sparse checkout so I only have
- trunk
- dir1
- c.txt
- d.txt
checked out. I decide I…

bradgonesurfing
- 30,949
- 17
- 114
- 217