38 questions
2
votes
1
answer
61
views
In Windows Git Sparse Checkout does not work as expected and downloads unwanted files
I have a folder structure in a Git Repo like the following:
.
└── top_level/
├── invalid_file_names/
│ ├── <?>.txt
│ └── <<>>?.txt
└── valid_files/
├── ...
0
votes
0
answers
73
views
Git push sparse repository
I'm trying to customize a small part of a big repository, then have my customization pushed into a GitHub repository.
I've followed sparse cloning instructions to have the first stage done. Committed ...
1
vote
0
answers
85
views
Is it possible to push git sparse-checkout settings, so every team member has the same settings by default?
I am currently introducing a library from repository "B" to repository "A" as a submodule.
The Repository "B" referred to as a submodule includes additional test code and ...
1
vote
0
answers
47
views
Integrating Specific Subfolder from One Git Repository into Another Without Full Clone
I'm currently working on a project where I need to integrate a specific subfolder (folder F) from a repository (RepoA) into another repository (RepoB). I tried using git subtree and submodules, but ...
4
votes
1
answer
57
views
Git checkout with exclusions fails when branch isn't local
I'm trying to checkout a branch, but want to exclude the REAMDE.md and CHANGELOG.md files.
Working:
git clone [url] --no-checkout .
git checkout BranchnameA
git checkout BranchnameB # (any other ...
0
votes
1
answer
260
views
When doing a shallow git clone, how to limit git blame to the depth of the clone?
I have a short-lived process which does a shallow clone (e.g. git clone --depth 50 <repo>) of a huge repo with ancient history.
Part of the process, in some conditions, it uses runs git blame on ...
0
votes
1
answer
340
views
How to use git sparse-checkout with multiple matching patterns
I'm using git sparse-checkout to have only the files I'm interested in on disk. I'm unable to figure out how to match multiple patterns.
git sparse-checkout set --no-cone "**/*.tf"
Checkout ...
3
votes
1
answer
2k
views
How to undo git sparse-checkout add
Let's say I did a sparse checkout of a partial clone to not get everything from a big Git repo:
git clone --filter=blob:none --sparse https://example.com/url/of/my/repo.git
cd repo
git sparse-checkout ...
-2
votes
1
answer
1k
views
Clone a subdirectory from github using git
In git I want to download a folder from a Github repository and add it to a subdirectory in my repo like so:
repo/folder/subfolder/
repo/folder/subfolder/clonedfolder //cloned folder from git hub
But ...
3
votes
1
answer
645
views
Git sparse checkout^ some root folders fully recursive, some other root folders without subfolders
I use git 2.40 and I have repo folder structure like this:
└── root_dir1
│ ├── dir11
│ │ └── file11
│ │
│ └── dir12
│ │ └── file12
│ │
│ └── file13
│
└── root_dir2
...
0
votes
1
answer
532
views
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 ...
7
votes
1
answer
3k
views
How to prevent git clone --filter=blob:none --sparse from downloading files on the root directory?
As explained at How do I clone a subdirectory only of a Git repository? the best way I've found so far to download all files in a Git subdirectory only is:
git clone --depth 1 --filter=blob:none --...
8
votes
1
answer
3k
views
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/...
2
votes
0
answers
7k
views
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/...
0
votes
1
answer
404
views
git sparse-checkout existing repo serially
Here is what I am doing
First sparse-check-out
git clone --depth 1 --filter=blob:none --sparse https:<repo_path>
cd ./<local_repo_path>
git sparse-checkout init --cone
git sparse-...
0
votes
0
answers
541
views
Why can't I disable the sparse-checkout of Git?
I cloned a repository and found that it has the "SPARSE" after "master". I am not so familiar with git, so I search it in the official document, which says that I can disable it by ...
4
votes
1
answer
7k
views
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 ...
0
votes
1
answer
741
views
How to use git sparse-checkout in 2.25 and not checkout everything
So after trying multiple tutorials, questions/answers I am still not able to get git sparse-checkout working on Windows 10 with git 2.25
Background
Our repo moved from perforce to git recently and now ...
1
vote
1
answer
3k
views
Git Sparse checkout during Azure pipelines taking ~15 minutes
We have a single repo of our source code which if downloaded is around 2.8GB. We have 4 self hosted agents and over 100 build pipelines. With that, it is not feasible to download the entire source ...
8
votes
0
answers
2k
views
Can sparse-checkout patterns be added to .gitmodules?
Let's say I have a git submodule and I want to to enable sparse-checkout on it. Is it possible to do so and add that file to the repository for other people that clone? The git submodule gets added to ...
7
votes
1
answer
4k
views
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 ...
1
vote
2
answers
1k
views
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 ...
0
votes
1
answer
74
views
Sparse-checkout in git v28.0.0?
In git 26.0.2 I was able to perform these steps:
git worktree add --no-checkout ../test_git26 git26
cd ../test_git26
git sparse-checkout init --con
git sparse-checkout set Q/
ls
This ended nicely ...
5
votes
1
answer
3k
views
git sparse-checkout ignore specific file type
I have a git repository with a bunch of large csv in them, which I don't want to clone, so I came across git sparse-checkout and this post: https://github.blog/2020-01-17-bring-your-monorepo-down-to-...
1
vote
2
answers
889
views
git sparse checkout - can't abort merge
Using git 2.25.1
Used git sparse-checkout init/set to setup sparsecheckout.
Now I'm in situation that i need to abort merge.
Tried:
git merge --abort
Entry 'QStreams_xxx/infra/QPrism/Qpvc/...
15
votes
2
answers
5k
views
How do I clone, fetch or sparse checkout a single directory or a list of directories from git repository?
How do I clone, fetch or sparse checkout a single file or directory or a list of files or directories from a git repository avoiding downloading the entire history or at least keeping history download ...
1
vote
3
answers
3k
views
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
...
1
vote
0
answers
28
views
Asking git to ignore a folder that other people check code into [duplicate]
I'm working on a huge, sprawling, corporate git repo that lots of other people check code into. There are huge folders in it that are of no interest to me at all. I don't read or write code there, and ...
2
votes
1
answer
232
views
Git Sparse checkout ignore a bad directory
I have a directory name "[afdsklj]" in my git repo. It seems that git sparse checkout still gives me fatal error invalid argument when it tries to create the new directory. Is there someway to have ...
8
votes
2
answers
13k
views
Sparse checkouts - how does it works
I've been looking for a way to clone only a sub directory of one of my project. Obviously I found this answer. it is well designed and the step-by-step solution explain well how to implement this. Now ...
1
vote
1
answer
138
views
Git checkout single directory through Chef
Is there a way of doing an sparse checkout with Chef and its git resource? Or what is the best way to accomplish the equivalent of that?
As doing a sparse checkout requires modifying a file in the ....
15
votes
2
answers
13k
views
How to do submodule sparse-checkout with Git?
There are a lot of articles and SO questions about sparse-checkout. Unfortunately I did not find concrete examples. I would like to get this following example work:
Create a submodule
cd ~
mkdir sub ...
2
votes
1
answer
3k
views
Git copy only specific files from remote
I am trying to understand how (and if it is possible) to copy only specific files of a specific directory from remote in Git. (not interested in continuing working on those files or getting the ...
2
votes
0
answers
824
views
Git - Sparse checkout of submodule doesn't clone?
We have a submodule in our super project. That submodule uses a sparse checkout (think of the submodule as a large core library where we choose which parts are necessary for the current project). ...
1
vote
2
answers
1k
views
Checkout a Specific Folder within a Git Repository
I have multiple projects in different repositories:
tools
thirdparty
shared
├──Common
├──Exceptions
multimedia
├──VolumeControl
├──VideoRenderer
android
├──Audio
For example, android depends on ...
9
votes
1
answer
1k
views
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 ...
272
votes
16
answers
269k
views
Is it possible to do a sparse checkout without checking out the whole repository first?
I'm working with a repository with a very large number of files that takes hours to checkout. I'm looking into the possibility of whether Git would work well with this kind of repository now that it ...
299
votes
26
answers
382k
views
Retrieve a single file from a repository
What is the most efficient mechanism (in respect to data transferred and disk space used) to get the contents of a single file from a remote git repository?
So far I've managed to come up with:
git ...