A working copy of version controlled code which doesn't include the whole repository.
Questions tagged [sparse-checkout]
124 questions
13
votes
3 answers
Why do excluded files keep reappearing in my git sparse checkout?
I use the GCC git mirror and because I only use the C and C++ front ends I use git's sparse checkout feature to exclude the hundreds of files I don't need:
$ git config core.sparseCheckout
true
$ cat .git/info/sparse-checkout…

Jonathan Wakely
- 166,810
- 27
- 341
- 521
12
votes
1 answer
Git sparse checkout without leading directories
I understand how to configure a sparse checkout in Git, but I was wondering if it's possible to eliminate the leading directories. For example, say I have a Git repository with a folder structure like…

Scott Crooks
- 1,523
- 4
- 24
- 39
9
votes
2 answers
Sparse Git checkout of files into parent directory
Borrowing from a few tutorials, I am able to do a sparse checkout of a particular folder in a git repo.
mkdir git-completion && cd git-completion
git init
git remote add –f origin https://github.com/git/git.git
git config core.sparsecheckout…

helgatheviking
- 25,596
- 11
- 95
- 152
8
votes
4 answers
How to make git download a new folder after editing sparse-checkout?
I have a git repo where I only want to download certain subfolders. My config looks like this:
#.git/config
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
sparsecheckout = true
[remote…

Max Williams
- 32,435
- 31
- 130
- 197
7
votes
1 answer
failed to initialize sparse-checkout
I'm getting the below error when i try to clone a folder "banana" from git repository using sparse filter;
git clone --depth 1 --filter=blob:none --sparse https://github.com/gitexpert/testGithub.git
cd testGithub
git sparse-checkout set banana
GIT…

itgeek
- 549
- 1
- 15
- 33
7
votes
2 answers
Exclude directory during jenkins checkout
I have 20 directories under trunk
/trunk/a1
/trunk/a2
/trun/a3
..
..
/trunk/a20
How to exclude (not include) some (arbitrary directories during Jenkins checkout.
For example, I want to have all the directories under trunk except /trunk/a3/b1
How to…

Sriwantha Attanayake
- 7,694
- 5
- 42
- 44
6
votes
2 answers
Shallow AND Sparse GIT Repository Clone
I have a shallow cloned git repository that is over 1 GB. I use sparse checkout for the files/dirs needed.
How can I reduce the repository clone to just the sparse checkout files/dirs?
Initially I was able to limit the cloned repository to only the…

NOYB
- 625
- 8
- 14
6
votes
2 answers
Does SVN support merging into sparse checkouts?
I'm trying to merge a branch into a sparse checkout (all the files I touched in the branch are included in the checkout) and I'm getting the following error:
Cannot reintegrate into a working copy not entirely at infinite depth
Does this mean what…

Motti
- 110,860
- 49
- 189
- 262
6
votes
0 answers
How can I sparse checkout a subdirectory from git without checking out its parent directories?
I am trying to sparse-checkout a subdirectory from my git repository.
The repository contains multiple plugins for wordpress and I want to check them out one by one. With the below posted solutions I have encountered the problem that EVERYTIME I…

chris9r
- 61
- 3
6
votes
1 answer
Why does one call `git read-tree` after a sparse checkout
According to Subdirectory Checkouts with git sparse-checkout one calls git read-tree -mu HEAD after configuring a sparse checkout in the case of an already existing repository, i.e.:
# Enable sparse-checkout:
git config core.sparsecheckout true
#…

Micha Wiedenmann
- 19,979
- 21
- 92
- 137
6
votes
1 answer
Git sparse-checkout on a remote with a post-receive script
I'm trying to figure out how to do the following (and figure out if it's even possible).
I have a local git repo with a number of folders for various things, but I want to be able to deploy my website with git to my development server and really…

user1193694
- 121
- 1
- 8
5
votes
1 answer
Jenkins sparse checkout: only content of directory
I have a repo: hello.git. I'm able to perform a sparse checkout:
sparse checkout path: /test/test1
Now I have this in my workspace:
.../workspace/test/test1/content
I want to have the following:
.../workspace/content
Is it possible to checkout…

DenCowboy
- 13,884
- 38
- 114
- 210
5
votes
1 answer
How to do git-rebase with a sparse checkout?
I have a working copy with a sparse checkout enabled. And I want to do the git rebase -i. But if I get conflict while rebasing all of the excluded from checkout files are marked as deleted and not staged for commit.
So, when I do resolve real…

abyss.7
- 13,882
- 11
- 56
- 100
5
votes
1 answer
Tips and tricks useful to "checkout" (download) the Android source code more quickly
Viewing and searching the Android source code is simple. You simply visit the AndroidXRef website.
But, if you want to build and run the bleeding-edge version of Superuser, you must first download an entire Android source tree.
Imagine that I want…

unforgettableidSupportsMonica
- 257
- 2
- 17
4
votes
1 answer
Git "error : invalid path" during git checkout
When I'm trying to checkout to another branch from cmd:
git checkout Datascience_With_Python --
this error is occuring:
error: invalid path 'Datascience_With_Python/Machine Learning/Tutorials/Steps for Machine Learning "MLOps"/README.md'
error:…

rica_programmer
- 41
- 1
- 3