Questions tagged [shallow-clone]

82 questions
2
votes
3 answers

git shallow clone along with branch

I have to deal with a git repo that contains some binaries. I would be REALLY grateful if someone could explain this to me >git clone --depth 1 -- ssh://git/foo/bar.git test_d Cloning into 'test_d'... remote: Counting objects: 289, done. remote:…
GiM
  • 460
  • 4
  • 13
1
vote
1 answer

how to get files from shallow-then-unshallowed git clone?

In order to clone a really large repository via a slow internet connection, I did this: $ git clone http://.../large-repository --depth 1 $ cd large-repository $ git fetch --unshallow But then, all binary files (in my case, SolidWorks files) have…
Kjara
  • 2,504
  • 15
  • 42
1
vote
1 answer

List of files changed in top commit in shallow clone

Is it possible to get a list of files changed in the latest commit in a shallow-clone repository (clone depth = 1)? In my CI server I would like to fetch only the latest commit, due to performance reasons, and take further actions based on locations…
Krzysiek Karbowiak
  • 1,655
  • 1
  • 9
  • 17
1
vote
1 answer

Remove graft mark in git when history becomes available

I'm experimenting with git shallow clones and wonder if there is any possibility to "ungraft" a commit if I happen to fetch the parent of an already existing commit. Let's say I have a full repo with three commits looking like this…
chrillof
  • 325
  • 2
  • 15
1
vote
2 answers

How to add a shallow branch to a repo without SSH access

I have a shallow clone that I need to push to a remote repository (the remote repository does not contain any of the history from that branch). When I try to push it, it gives me an error about "Shallow update not allowed". I tried to do it on a…
Stefan
  • 27,908
  • 4
  • 53
  • 82
1
vote
1 answer

git shallow is not working for submodules over jenkins?

I am working on the esp-idf as submodule for my development and I have also integrated Jenkins for the same. It is running perfectly without shallow clone feature added over Jenkins. But, when I tried to clone submodule with shallow clone with depth…
1
vote
0 answers

how to run set-branches at origin in GitPython

I am working with shallow-clone and shallow fetch with GIT repo, There is Git-Python being used in the code In Git-python, what would be equivalent command for the following git cmd command git remote set-branches origin --add master8 I read their…
John Byro
  • 674
  • 3
  • 13
1
vote
1 answer

git - fetching from a specific branch although repository wasn't cloned with '--single-branch'

To make a long story short, what I'm looking for is to be able to fetch only a specific branch in a local repository, even though this repository wasn't originally cloned with "--single-branch -branch ". To share the complete story - we…
ilani
  • 45
  • 4
1
vote
2 answers

Error while updating Homebrew on my MacBook pro Big Sur

Updating homebrew I received the following error: Error: homebrew-core is a shallow clone. To `brew update`, first run: git -C /usr/local/Homebrew/Library/Taps/homebrew/homebrew-core fetch --unshallow This restriction has been made on GitHub's…
Veasna Mam
  • 21
  • 1
  • 4
1
vote
1 answer

git shallow clone *several* specific refs (commits), *which are not branches*

For my specific use case, I only need a shallow git clone that contains just two specific commits, and nothing else (no remaining history, no other branches). Here are some things I tried: I want to fetch two refs, hence git clone --single-branch…
jakub.g
  • 38,512
  • 12
  • 92
  • 130
1
vote
1 answer

how to use git "--unshallow" with a "--single-branch" clone?

I first shallow-cloned a repo with depth=1. cd $folder_path git init git remote add $my_remote $url_to_repo git fetch $my_remote $my_branch --depth=1 git reset --hard $my_remote/$my_branch cd - I then tried to unshallow the local clone by running…
Guillaume D
  • 2,202
  • 2
  • 10
  • 37
1
vote
1 answer

nodejs shallow git clone using simple-git

I'm trying to create shallow clone using simple-git. I'm trying to create an equivalent of this command: git clone --depth 1 https://github.com/steveukx/git-js.git. My code is as follows: const git = require('simple-git')() const repoURL =…
Yury Stanev
  • 419
  • 1
  • 5
  • 16
1
vote
2 answers

Git shallow clone: only branches with activity last X months

There is a long running repository of a project that's much larger than I want or need. I shallow cloned the last few months but did not use --no-single-branch, so my local repo only knows about origin/master and I can't checkout any other…
matt wilkie
  • 17,268
  • 24
  • 80
  • 115
1
vote
2 answers

How to make a visible github fork without the commit history?

Let's say you want to clone an old (GitHub) repository A into your own repository B. However, you don't need any branches nor do you want the very long commit history. What you want is a shallow clone as a snapshot of the most current status of the…
not2qubit
  • 14,531
  • 8
  • 95
  • 135
1
vote
1 answer

Create proper Git repositories from a Catchall (dirty) one

Let's call my-dirty-repository an existing Git repository containing lots of scripts which are not related. It is a catchall repository which needs to be properly cleaned. As a Minimal, Complete, and Verifiable example, let's say this repository…
Bsquare ℬℬ
  • 4,423
  • 11
  • 24
  • 44