Cache .git versus persist_to_workspace

#1

Using the v2.0, I’m caching my .git directory in the build job, then in subsequent jobs I’m retrieving the cache and checkout it out. Wouldn’t it be fast to just persist to workspace the working directory? (The answer is yes, because I’ve tried it, I’m just not sure why the docs seems to suggest otherwise)

0 Likes

#2

Where in the Docs do you see this?

What is the ultimate point in moving your .git/ directory into additional jobs?

0 Likes

#3

It’s referenced in the docs: https://circleci.com/docs/2.0/caching/#source-caching

0 Likes

#4

I’m still definitely interested in this idea. I’m getting the sense from @FelicianoTech 's comment that this is not actually the recommended way to persist a codebase through jobs.

0 Likes

#5

The idea behind this is to cache your Git repo for pulling from GitHub via the checkout step. The Workspaces Doc shows that Workspaces typically are the fastest way to move data between jobs.

0 Likes

#6

Please note that the checkout step is currently broken when caching the .git directory and you try to build a tag:

0 Likes

#7

that makes sense, thanks.

1 Like

closed #8

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.

0 Likes