How to clean GitLab workspace quickly?

Viewed 25

Due to previous build artifacts, the next build clone taking lots of time to clone new code. First it will remove the previous workspace (remove all artifacts which are stored), then it is clone the new code. How we can make this cycle faster?

1 Answers

As far as I understood You need clone repo once, and want to update it ieach time you need ti build artefacts. Also I understood you build your artefacts right in git workspace. If You 'd like to clean workspace from any files and/or folders not related with your repo You can use the git clean -fd. Also, You can imitate this command, to see what files will be delete, use the command git clean -nfd

If You have this problem during the gitlab runnner works check option CI/CD Settings/General/Git strategy for pipelines it nust be set on git fetch instead of git clone See image below

Related