0

Is it possible to download from a remote git repository (not necessarily github) sources at a given version based on sha1 commit or tag whithout getting history?

We actually do:

git clone repo
git checkout vx.y.z

This is taking a lot of time in our CI system and in our special context we don't care about git history.

Context:

Our build job need to download a CORE version of an application at a given version.

Then, it downloads all the additional plugins at a given version and performs CI stuffs. It concerns an old legacy app that is not managed with a dependency manager and the plugins are stored inside subdirectories of the CORE, that's why we need to have retrieve sources from different repos and we don't care about git history that took too much time to be retrieved.

We would like to do a kind of:

git magic-command repo vx.y.z

and get only sources at revision of vx.y.z without retrieving all history.

ben.IT
  • 1,490
  • 2
  • 18
  • 37
  • 1
    Not an exact duplicate, but the answer to your question is yes, you can do this via a shallow `git clone`. Read the duplicate for more information. – Tim Biegeleisen Aug 03 '18 at 06:19
  • thanks for the link : `git clone --depth=1 repo vx.y.z, for instance` did the trick. For instance: `git clone --depth=1 git@github.com:moodle/moodle.git v3.5.1` – ben.IT Aug 03 '18 at 06:59

0 Answers0