jenkins Wipe out repository and force clone vs Clean before checkout

匿名 (未验证) 提交于 2019-12-03 03:06:01

问题:

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 :)

回答1:

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.



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!