Git clone via script using cache?

Paul Moors January 24, 2025

Working with cached repositories on the agents works fine with the Source Code Checkout task in Bamboo. Now I'm wondering, when using a bamboo script-task, on how use these caches when doing a git clone command.

I noticed that git clone ${bamboo.planRepository.1.repositoryUrl} is working fine, but is the cache being used in that case?

1 answer

1 vote
Shashank Kumar
Atlassian Team
Atlassian Team members are employees working across the company in a wide variety of roles.
January 27, 2025

Hello Paul,

Welcome to Atlassian Community.

I don't think so if you run git clone via a script task it will use the cache.

A simple GIT clone command won't know the path where caches are stored. As the cache folder name is created based on the URL and some other combination. Source code checkout task is designed to look for the cache in the particular folder which a simple git clone command won't be. 

You can probably refer this https://randyfay.com/content/reference-cache-repositories-speed-clones-git-clone-reference

Regards,

Shashank Kumar

**please don't forget to Accept the answer if your query was answered**

Suggest an answer

Log in or Sign up to answer
TAGS
AUG Leaders

Atlassian Community Events