Using a Git reference repository Bee Bot July 13, 2022 11:18 Updated The content of this article has moved to the new documentation site. Related articles How to Customize Checkout for Pipeline Multibranch? Why is my multibranch project cloning the whole repository on the controller? Pipeline - Equivalent to Git Publisher I have a stuck Pipeline and I can not stop it How to apply custom styling to my instance? Comments 6 comments Sort by Date Votes Rafael Rezende December 01, 2017 14:15 This is a great feature! One thing which is not clear to me though: is the update happening only when the fetch command is explicitly called? Or the does plugin always force the local clone to get the latest updates from remote on every build? 0 Allan Burdajewicz January 05, 2018 09:03 Rafael, The current versions of the Git and Git client plugin do not update the reference repository automatically. The reference repository must be updated manually. This is what the additional step "Periodically update the reference repository with the latest content from the original repository" is about. Regards, 0 Nathan Neulinger February 14, 2018 04:04 I had used this functionality a few years ago - and it indeed made a huge improvement in space and performance - however, I ran into one issue that I'd be interested in knowing if has been resolved. When I would update the reference repository - it seems like it would periodically result in broken/dangling references/links/etc. within the clones referencing it. It may have been in response to a gc or repack that was triggered in the reference copy. It's been a while though since I used this. I'm looking to use it again though. Do you know if this is something that I was likely doing wrong with my update process previously, or should I be taking any special action in how the reference repository is used in the jobs? 0 Gautier Seidel March 08, 2018 15:59 Hi, Cloning using a reference works fine. However, the cloned repository is not standalone, the reference is still needed.As a result, when the cloned repository is used within a docker container where the reference is not available, git complains like: error: Could not read 26fa13ae7fbe6eb887dfbdf182a6218d790203cdfatal: Failed to traverse parents of commit 82d549106c0b85d3e1e4444df018ba3f7cbb3d0a From git manual, the 'dissociate' option should do it: https://git-scm.com/docs/git-clone#git-clone---dissociate How to pass the 'dissociate' option to GitSCM? thanks, gautier 0 René Scheibe June 13, 2018 16:49 Edited Should the combined reference repository really be working with submodules added as remotes? When cloning as suggested I get an error as follows: submodule 'submodule1' cannot add alternate: path '.../reference-repository/.git/modules/submodule1/' does not existCloning into ... Cloning searches in the reference repository under modules/submodule1/ where they are not provided in a bare repository. For a non-bare repository with inialized submodules this location would be correct. Working solution: Cloning the main repository bare as suggested and providing all required submodules cloned under the modules/ folder (reproducing the expected structure). 0 Ray Ichihara January 10, 2020 22:24 Is it possible to have a reference repo on the master that can be accessed by the agents? What would a sample path look like? 0 Please sign in to leave a comment.