jenkins在结账前清除存储库并强制克隆与清理 [英] jenkins Wipe out repository and force clone vs Clean before checkout

查看:720
本文介绍了jenkins在结账前清除存储库并强制克隆与清理的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图了解两个选项擦除存储库和强制克隆和清理前检查之间的区别,以便拉动git回购。看看这两个选项的帮助部分,两者似乎都有类似的功能,我无法区分它们的区别。以下是它们的外观:


清除存储库&强制克隆:


在构建之前删除工作区的内容,以确保全新的工作区。
blockquote>

结帐前清理


在每次结帐前清理工作区,方法是删除所有未跟踪的文件和目录,包括在.gitignore中指定的目录。它还会将所有跟踪的文件重置为其版本状态。这可以确保工作空间处于与您在全新的空目录中克隆和检出相同的状态,并确保您的构建不受上一个构建生成的文件影响。



我找不到两个选项之间的任何比较;既不在Jenkins / GitPlugin wiki中,也不在堆栈溢出中,甚至不在谷歌中。我们目前有两种选择,但我们计划通过删除擦除存储库和强制克隆选项来缩短构建时间。但是我不想在这样做的时候打破任何功能。如果您确定,请解释差异。提前致谢:)

解决方案

清除存储库&强制克隆将清理整个项目工作区并在构建之前再次克隆该项目。这可能会耗费时间,取决于项目的规模。如果项目为1GB,则每次构建时都下载1GB。



结帐前清理可删除作为构建一部分创建的文件 - 测试结果等 - 重新设置文件,如果它们已更新&如果更新了最新的更改,则会提取最新的更改。 确保工作区处于与您在全新的空目录中克隆和检出相同的状态。它只下载可能只有几个MB的增量。所以它不会浪费时间。



因此,您可以继续在结帐前使用清理,而不会影响构建。
使用这个选项超过4年没有任何问题。


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.

这篇关于jenkins在结账前清除存储库并强制克隆与清理的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆