当前位置:   article > 正文

jenkins如何清缓存_jenkins在结账前清除存储库并强制克隆与清理

force clone

I am trying to understand the difference between the two options “Wipe out repository and force clone” and “Clean before checkout” for pulling a git repo. Looking at the help section for both options, both seem to have similar functionality and I can't make out the difference. Here's how they look:

Wipe out repository & force clone:

Delete the contents of the workspace before building, ensuring a fully fresh workspace.

Clean before checkout

Clean up the workspace before every checkout by deleting all untracked files and directories, including those which are specified in .gitignore. It also resets all tracked files to their versioned state. This ensures that the workspace is in the same state as if you cloned and checked out in a brand-new empty directory, and ensures that your build is not affected by the files generated by the previous build.

I couldn't find any comparison between the two options; neither in Jenkins/GitPlugin wiki, nor in stack overflow, and not even in google. We currently have both options, but we are planning to reduce build time by removing the “Wipe out repository and force clone” option. But I don't want to break any functionality while doing this. Please explain the difference if you're sure. Thanks in advance :)

解决方案

Wipe out repository & force clone will clean the entire project workspace and clone the project once again before building. It could be time consuming depends on the project size. If the project is 1GB, it downloads 1GB everytime you build it.

Clean before checkout removes the files created as part of build - say your test results etc - resets the files if they were updated & pulls the latest changes if they have been updated. This ensures that the workspace is in the same state as if you cloned and checked out in a brand-new empty directory. It downloads only the delta which could be few MBs. So it is less time consuming.

So you can go ahead use Clean before checkout without affecting the build.

Have been using this option for more than 4 years without any issues.

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/小丑西瓜9/article/detail/579651
推荐阅读
相关标签
  

闽ICP备14008679号