Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Repository clean up

Tags:

cmake

conan

I am adding Conan support to my CMake projects. I followed Recipe and sources in the same repo tutorial and I end up with the expected package. Exploring the local repository folder, I found out that my source files are copied in 3 different folders (source, build and export_source) so the repo is growing fast even with small projects.

Is there a way to clean repository folders where sources are duplicated, after package creation (keeping only the folder needed for "dependency build from sources")?

like image 448
Marco Stramezzi Avatar asked May 09 '18 07:05

Marco Stramezzi


People also ask

What is cleanup in git?

Summary. To recap, git clean is a convenience method for deleting untracked files in a repo's working directory. Untracked files are those that are in the repo's directory but have not yet been added to the repo's index with git add .

How do I reduce the size of my repository?

To reduce the size of your repository in GitLab, you must first remove references to large files from branches, tags, and other internal references (refs) that are automatically created by GitLab. These refs include: refs/merge-requests/* for merge requests. refs/pipelines/* for pipelines.


Video Answer


1 Answers

Sure, you can remove things from the cache with the conan remove command. In this case you probably want to do:

conan remove "*" -s -b -f
  • * to match all packages in your local cache
  • -s to remove the source folders
  • -b to remove the build folders
  • -f to not ask for confirmation

The sources stored together with the conanfile.py in the cache, can't be removed, cause they are stored with the conanfile to be able to rebuild from sources when conan install --build is done.

like image 94
drodri Avatar answered Oct 19 '22 12:10

drodri