Questions tagged [shallow-clone]

82 questions
11
votes
2 answers

A way to keep a shallow git clone just minimally up to date?

My aim is to be able to both build recent versions of, and contribute to, a project that has a long and voluminous history - and to do this without using local storage to duplicate lots of historic branches and history going back a decade and more…
Chapman Flack
  • 604
  • 5
  • 13
9
votes
2 answers

Jenkins Pipeline: scm checkout shallow copy fails

I am using Jenkins file to build a pipeline. I am trying to clone the reference repository using DSL like below. checkout( [$class: 'GitSCM', branches: [[name: '*/master']], doGenerateSubmoduleConfigurations: false, extensions: [[$class:…
Abhishek Lodha
  • 737
  • 2
  • 7
  • 30
7
votes
1 answer

git fatal: error in object: unshallow

I'm trying to unshallow a repository: % /bin/git clone --shallow-since='3 years' 'https://github.com/RobertAudi/zsh-hooks' Cloning into 'zsh-hooks'... remote: Enumerating objects: 17, done. remote: Counting objects: 100% (17/17), done. remote:…
Tom Hale
  • 40,825
  • 36
  • 187
  • 242
7
votes
3 answers

git shallow clone since specific commit

I'd like to clone a repository with a longish history. I'm only interested in a few short-lived not-yet-merged feature branches and master. In order to not confuse myself with all that past history and merged branches, I'd like to do a shallow clone…
umläute
  • 28,885
  • 9
  • 68
  • 122
6
votes
2 answers

Convert shallow repo to normal repo

I have "shallowed" a repo: FIRST_COMMIT="bf450342272a94117d78eae34a140a2a39359dad" git rev-parse ${FIRST_COMMIT} > .git/shallow git fsck --unreachable git gc --prune=now Now I try to push: ! [remote rejected] develop -> develop (shallow update not…
blueFast
  • 41,341
  • 63
  • 198
  • 344
5
votes
1 answer

git narrow clone single file real life example

We read about git narrow clones. Let's say we want to use this new feature in the extreme and just with minimal bandwidth edit one file from a massive remote repository and push back our commit. The only examples one finds are git clone…
Dan Jacobson
  • 490
  • 3
  • 14
5
votes
1 answer

git: clone specific commit id on a shallow clone

I found a lot of questions/answers about cloning a repository and checking out a given commit ID immediately. Trivial approach: git clone working-copy cd working-copy; git checkout With branches you can just git clone -b
frans
  • 8,868
  • 11
  • 58
  • 132
4
votes
1 answer

Why can't I push tags in GitHub workflows anymore, and how do I fix it?

My team has a GitHub release workflow that automatically tags our prod branch on push. It has been working fine for the last year, with the most recent success being May 2, 2022. This workflow failed on May 11, 2022, and now I can't figure out how…
krivard
  • 652
  • 6
  • 17
4
votes
0 answers

Swift Package Manager: shallow clone

The problem: I'm using the nlohmann/json package with Swift Package Manager. Package.swift manifest file By looking at the package manifest, it's clear that the library includes just a single file and a header. However, in order to install the…
4
votes
1 answer

Should I declare method "const" if it is "shallow const" only, not "deep const"?

I have class Foo and its member bar_ is a pointer to some data. Method modify modifies the data, but not the pointer itself. Therefore I can declare the method as const: class Foo { public: Foo() : bar_(new double) {}; void modify() const…
IBazhov
  • 175
  • 8
4
votes
1 answer

Convert git full clone into a shallow clone

How can a deep clone of a repository be turned into a shallow copy IN PLACE? I am managing separate installations of our software using git to track any changes to the code in the installation made runtime (untracked & dirty files), but the…
Ákos Vandra-Meyer
  • 1,890
  • 1
  • 23
  • 40
4
votes
1 answer

Creating a sparse and shallow clone of a git repository results in error: trying to write non-commit object

I want to create a sparse and shallow clone of a git repository at a certain tag. This is what I am currently doing: git init avatica-tmp cd avatica-tmp git remote add origin https://github.com/apache/calcite-avatica/ git config…
F21
  • 32,163
  • 26
  • 99
  • 170
4
votes
2 answers

how to get full commit log from a shallow clone?

Is it possible to get the commit log history from a local copy which is a shallow clone (--depth = 1) I am using shallow clone in my jenkins build job to get the code and build but the changelog is not complete because I am using shallow clone. Is…
g.revolution
  • 11,962
  • 23
  • 81
  • 107
4
votes
1 answer

How to maintain shallow clone of a set of branches in git

I'd like to maintain a shallow, mirrored, bare clone of several branches. I will clone locally from that for different project branches. e.g. +------------------------------------------------------------------+ | repo1: server1:original-repo.git…
artfulrobot
  • 20,637
  • 11
  • 55
  • 81
4
votes
2 answers

Make a shallow GIT repository less shallow

I create a shallow clone for a specified tag: git clone --branch v0.1.3 --depth 1 file:///c/usr/sites/smc . After this the cloned repo only has the tag v0.1.3 (and associated files) in it. It does not have the history for all the changes before or…
Paul Chernoch
  • 5,275
  • 3
  • 52
  • 73