137 questions
0
votes
0
answers
63
views
Git blame with historical blob data back to a specific commit pre-fetched in a sparsely checked out repo
I am trying to achieve a combination of
operating in a sparsely checked out repo
being able to run a git blame operation with line details - but not triggering a network fetch for each historical ...
0
votes
0
answers
86
views
Is it possible to apply git sparse-checkout on files not directories?
I have a repo I would like to clone with a structure like this:
repo/folder1
repo/folder2
repo/file1
repo/file2
I want to keep folder1 and nothing else.
When I try git sparse-checkout init --cone, it ...
1
vote
1
answer
161
views
Git clone and download only the files that need changed and committed
We have a repository with several large sql files, ranging from 100MB to 10GB in size.
Been trying to setup local cloning so we only download the sql file(s) that need changed and committed at any ...
0
votes
2
answers
44
views
browse sparse git checkout
In a sparse git checkout, one does not see the folders (directories/trees) that haven't been added via git sparse-checkout add.
I can still "browse" these folders with git cat-file -p HEAD ...
2
votes
0
answers
49
views
Mercurial: get only a specific, nested folder from a subrepo
I'm aware that similar questions have been asked in the past, however, since the newest of them are pushing on being a decade old, I feel it's reasonable to try again with my particular problem.
I ...
0
votes
1
answer
156
views
How to sparse pull from a repo while full push/pull to/from another?
I don't know if I am making things clear or not (since I am not an advances git user), so please ask follow up questions to better understand where I'm coming from.
Consider this repo: Void Linux ...
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 ...
0
votes
0
answers
43
views
Clone a folder of a git repository, mapping it to a different local path
Suppose, my remote git repository looks like this:
Repository
├── Folder1
│ ├── p1.py
│ └── p2.py
├── Folder2
│ └── p3.py
├── file1
└── file2
I want to download only the descendants of Folder1, ...
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 ...
2
votes
1
answer
1k
views
How to get past git giving hint to "disable or modify the sparsity rules" when "worktree is not sparse"?
I rarely use a sparse checkout (more likely to use a shallow clone). I almost always use a .gitignore file. That file is sometimes configured to ignore directories or files that are already part of ...
1
vote
0
answers
53
views
How to clone only a git subdirectory and get the date/time of the last commit into that subdirectory
As a (late) followup on How do I clone a subdirectory only of a Git repository?, I additionally need the date and time of the latest commit in that subdirectory. However, the --depth=1 command only ...
0
votes
1
answer
348
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 ...
1
vote
1
answer
75
views
How to generate a tree hash of a git sparse checkout?
You can get the hash of a tree in a commit by doing:
git rev-parse 'HEAD^{tree}'
And you can get the hash of the tree in the index by doing:
git write-tree
However, in the case you did a sparse ...
3
votes
1
answer
656
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
603
views
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 ...
1
vote
1
answer
689
views
Git sparse checkout a subfolder into a different location inside my repo folder
Let's 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 ...
1
vote
0
answers
660
views
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 ...
4
votes
0
answers
934
views
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
...
0
votes
0
answers
340
views
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:
...
0
votes
1
answer
542
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 ...
2
votes
0
answers
6k
views
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 ...
1
vote
1
answer
119
views
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 ...
2
votes
0
answers
2k
views
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:...
0
votes
0
answers
101
views
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 ...
1
vote
1
answer
511
views
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....
-1
votes
1
answer
479
views
New folders created in a Git repository are shown as empty on disk
I am new to Git and I am having some problems when creating new folders.
I have a sparse-checkout of a repository (as I don't need the whole thing) and I created a new folder with some files in it, ...
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/...
5
votes
1
answer
3k
views
How to Sparse checkout with Tortoise Git?
The working way to sparse checkout using git bash is:
git clone \
--depth 1 \
--filter=blob:none \
--sparse \
https://github.com/darc-coder/FindMyQRApp \
cd test-git-partial-clone
git sparse-...
1
vote
1
answer
401
views
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 ...
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
0
answers
129
views
Weird behavior of git sparse-checkout
I have a remote named [email protected]: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 ...
0
votes
1
answer
496
views
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 ...
0
votes
1
answer
122
views
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 ...
3
votes
1
answer
2k
views
Git clone is not working due to bad file path
Problem
Git cloning the repository on a Windows 10 machine throws this error:
error: invalid path 'saleor/graphql/core/tests/cassettes/test_get_oembed_data[http:/www.youtube.com/watch?v=dQw4w9WgXcQ-...
1
vote
1
answer
865
views
Download newly sparse checkedout files when pulling in git
Lets say I create a git repo. I enable sparse checkout and then I add some files in git/info/sparse-checkout.
After that, i add a origin and pull. Now i will only have the files matching the pattern ...
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 ...
0
votes
1
answer
94
views
Undo git checkout.. with a twist
First of all, let me make one thing clear: although there are a LOT of questions about undoing a git checkout, this is not (at least as far as I can assess) a duplicate question.
Now let me explain my ...
0
votes
2
answers
1k
views
How to checkout or clone a folder without downloading its parent folder
I want to checkout only a folder from gitlab without its parent folder and other parent folder in the hierarchy.
Our gitlab repository structure is something like this hybris/bin/custom/asamp. There ...
225
votes
22
answers
285k
views
github/git Checkout Returns 'error: invalid path' on Windows
When I attempt to checkout a repository from github I get the error:
error: invalid path 'configs/perl-modules/DIST.64/perl-HTML-Tree-1:5.03-1.el6.noarch.rpm'
I suspect the issue is that the path ...
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 ...
1
vote
1
answer
1k
views
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 ...
3
votes
2
answers
3k
views
Gitlab CI and Git partial clone
I am testing the git partial clone feature on a large monorepo. A developer might run the following commands on his machine:
git clone --filter=blob:none --sparse THE_MONOREPO_URL.git
git sparse-...
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-...
2
votes
1
answer
870
views
Git and sparse-checkout on large monorepos - hiding irrelevant changes for a sparse-checkout specification? (git-diff, git-log, etc)
As git is increasingly advertised (and enhanced) to better support very large repositories (so-called "monorepos"), with major recent enhancements to the sparse-checkout workflow (git-sparse-...
0
votes
1
answer
314
views
Does sparse-checkout act on tracked file?
My local and remote server both are centos 7.
I tracked README.md in local repo with git version 1.8.3.1.When I revised README.md and push to remote bare repo, I don't want README.md to be checked out....
2
votes
0
answers
103
views
Same git size with and without --depth=1
I am writing a script that clones a large git repository, modifies a few files and pushes the changes back to the remote. It needs to run as fast as possible.
Right now, it takes about 10 minutes to ...