A working copy of version controlled code which doesn't include the whole repository.
Questions tagged [sparse-checkout]
124 questions
1
vote
1 answer
git move portion of old repository to a new repository
I've a repository which contains several directories at the root, e.g.
gitroot/a
gitroot/b
gitroot/c
And I would like to create a new git repository from only the contents of a, whilst retaining its history. Is this possible? I've seen the sparse…

user1207217
- 547
- 1
- 4
- 15
0
votes
1 answer
git sparse checkout and get all branch
My Requirement was to checkout a specific directory from a repo and also checkout each branch which has that directory and copy each branch directory to a target path.
For Example football is a repo and src/ronaldo is the directory which I am trying…

Selvathalapathy S
- 27
- 5
0
votes
0 answers
How to set the git sparse-checkout with two depth directory?
I try to setting git environment, only fetch some specific directory.
Many people recommend spare-checkout and it is useful.
But still it has some happening.
What I want is that if My project is consisting of two depth directory, like…

KS_No
- 13
- 3
0
votes
1 answer
Git sparse checkout a subfolder into a different location inside my repo folder
Lets assume we have a Git repo with a three-level subfolder:
|_
|_Folder1
|_Folder2
|_ SubFolder2
|_ SubSubFolder2
I need to sparse checkout this folder and place it into a different location inside C:\MyRepo folder (on…

bairog
- 3,143
- 6
- 36
- 54
0
votes
0 answers
Cloning files from the sub module repository, using git sparse-checkout
Good afternoon, I have a local repository of my project where I use the fmt repository as a sub module.
I add the sub module like this (so that it would initialize to the path I want):
git submodule add https://github.com/fmtlib/fmt.git…

Aleksandr
- 1
- 2
0
votes
0 answers
How to create a git worktree of sub path
Is there something similar to git worktree add directory commit-ish:SUB_PATH?
Use Case
I have the following structure
- alpha
|- VERSION
\- file.txt
\- sub
- beta
And the goal is to check out the repo as following
- .git
- alpha
|- v1
…

weshouman
- 632
- 9
- 17
0
votes
0 answers
git sparse-checkout, missing branch name associated with the commit from the last tag
as in the title, I’m using git sparse-checkout, and I’m missing commits between the last git tag and the last commit I’m on. It creates a problem that I will try to describe it in a few points below:
I use git sparse checkout to get only a small…
0
votes
1 answer
Jenkins Git Sparsecheckout multiple repositories
I'm trying to setup a shared library within Jenkins that would have multiple git repositories and then multiple directory paths? Is this even possible? I've looked around a bit and the example's I have seen were here SparseCheckout in Jenkinsfile…

forest0918
- 55
- 8
0
votes
0 answers
How to clone only one subdirectory from Git repository?
I have following repository:
= dir 1
-- subdir1
-- subdir2
= dir 2
And I want to clone e.g. dir2 and dir1/subdir1. I followed instructions from this question: How do I clone a subdirectory only of a Git repository?
and I've made this:
mkdir…

Raf1k
- 31
- 6
0
votes
0 answers
Sharing the details of a sparse submodule checkout such that future clones inherit those details
What I want to do:
Add a submodule to an existing repo
Do a sparse checkout on that repo (only populate a subset of the working tree)
Make it so that when other people clone/pull that repo, the details of that sparse checkout are inherited (so they…

Danny Garside
- 37
- 8
0
votes
0 answers
How to configure git sparse-checkout so that it checks out entire repository, with the exception of particular directory?
I am aware that a very similar question has been asked before,
but not only is the provided answer awful and doesn't answer the question, but it seems there is no consensus about the technique as well.
And even after searching on the net in general…

Scrontch
- 3,275
- 5
- 30
- 45
0
votes
1 answer
Git log returns different results when running on another machine
Can someone please explain how this is possible that "git log -1" returns different hash on the same repository on different machines (repositories are fully synced)?
we have several docker containers that run cron jobs and periodically pull the…

Yury Kozlov
- 1,286
- 1
- 11
- 9
0
votes
0 answers
Weird behavior of git sparse-checkout
I have a remote named git@github.com:MyOrg/my-repo.git
There are several folders within its root directory.
I only want to fetch ONE of them, named datadog.
I am running the following commands
$ g clone --no-checkout --depth=1…

pkaramol
- 16,451
- 43
- 149
- 324
0
votes
1 answer
Why are all of my local git repositories "sparse checkout" after upgrading to git 2.32?
I've just upgraded to git 2.32 on my Mac (through brew install git).
Now my git-prompt says (branchname|SPARSE) on all local repositories.
I have to run git config core.sparsecheckout false on each repository to get this label to go…

Matt Montag
- 7,105
- 8
- 41
- 47
0
votes
1 answer
Sparse checkout leaves no entry on working directory when using git-externals
We're migrating from SVN to git and now having the problem that we need any replacement for our svn externals. Unfortunately, submodules are not solving our problems since any change in the submodule requires an update of the parent project. So we…

Nrgyzer
- 783
- 1
- 14
- 38