Clearing the source cache?

I had pushed a bad tag, and couldn’t find a way to get CircleCI to refresh the source cache, so ended up putting some temporary commands in post-checkout. Is there a simpler way?



I have similar issues and have yet to find a workaround to this. The caching docs on CircleCI should really reflect that there are two separate caches and you can only clear one presently.

Yes! Is there any way to do this? We had some huge files committed by accident and used bfg to remove them, and we’d like a way to make sure it doesn’t happen again. We want the tests to fail if big files exist in the history, using

but we need to clear the old cache.

The rebuild without cache option doesn’t do what you need?

No, doesn’t work. +1 for infos about how the delete the source cache. Would expect the source cache to be cleared at a rebuild without cache, but it doesn’t.

My apology, I really thought it did as part of a successful build.

In that case I recommend the delete cache API endpoint.

This doesnt work either. Please provide a way to clear the source cache from the UX.

This is still a problem.

I have a release process which uses git tags to generate unique resources for each release. Some “testing” tags were committed at one point and subsequently deleted, but they remain in CircleCI’s source cache. Now for every release the generated resources are labeled with “testing-deployment-2” instead of “release-vX.Y.Z”. This is resulting in conflicts (every release’s resources have the same name) and failed deployments.

I see that new tags appear in the cache. If tag deletions were reflected in the cache, this wouldn’t be a problem.


Is there any solution?

I did some digging and it looks like at this time you will need to create a feature request to add the ability to delete the source cache via the UI or API…

In the meantime, if you email with your org/project url on CircleCI we can manually delete the source cache for you.

Not sure this would work with the master branch but you can create a new branch from the old one and it won’t have the cache

the cache is per branch

Each branch of your project will have a separate cache. If it is the very first build for a branch, the cache from the default branch on GitHub or Bitbucket (normally master) will be used. If there is no cache for master, the cache from other branches will be used.

Has there been any update on this? I would really, really like to be able to clear my source cache. I have a ref that I accidentally pushed called, for example, folder/file. I realized I really wanted folder/file/test, so I deleted folder/file, but since git has some intricate treatment of branches with slashes in their names (which I was not aware of at the time), I am unable to fetch the folder/file/test branch since circle is seemingly caching the ref to folder/file. Renaming the branch isn’t feasible since we use branch names as a way to figure out where to deploy (staging, production etc).



If you contact us at with the project name we can clear the source cahe for you.

I had the same problem. I solved it rebuilding the project with SSH enabled. After logging into the instance, I manually removed the mistaken tag:

git tag -d <tag_name>

Builds run after that won’t include the tag anymore.

1 Like