37 questions
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
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 ...
0
votes
1
answer
256
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 ...
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 ...
3
votes
1
answer
640
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
...
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 --...
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
0
answers
538
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 ...
0
votes
1
answer
738
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 ...
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 ...
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 ...
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-...
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
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 ...
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 ...
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
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). ...
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 ...
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 ...