Sorry for the 'svn' style - we are in a process of migration from SVN to GIT (including our CI Jenkins environment).

What we need is to be able to make Jenkins to checkout (or should I say clone?) the GIT project (repository?) into a specific directory. We've tried some refspecs magic but it wasn't too obvious to understand and use successfully.

Furthermore, if in the same Jenkins project we need to checkout several private GitHub repositories into several separate dirs under a project root, how can we do it please?

We have GitHub plugin installed. Hope we've phrased the things right.

解决方案

The default git plugin for Jenkins does the job quite nicely.

After adding a new git repository (project configuration > Source Code Management > check the GIT option) to the project navigate to the bottom of the plugin settings, just above Repository browser region. There should be an Advanced button. After clicking it a new form should appear, with a value described as Local subdirectory for repo (optional). Setting this to folder will make the plugin to check out the repository into the folder relative to your workspace. This way you can have as many repositories in your project as you need, all in separate locations.

Alternatively, if the project you're using will allow that, you can use GIT sub modules, which are similar to external paths in SVN. In the GIT Book there is a section on that very topic. If that will not be against some policy, submodules are fairly simple to use, giving you powerful way to control the locations, versions/tags/branches that will be imported AND it will be available on your local repository as well giving you better portability.

Obviously the GIT plugin supports checking out submodules, so Jenkins can work with them quite effectively.

git jenkins 子目录_在Jenkins中,如何将项目签出到特定目录(使用GIT)相关推荐

  1. git jenkins 子目录,在Jenkins中,如何将项目签出到特定目录(使用GIT)

    Sorry for the 'svn' style - we are in a process of migration from SVN to GIT (including our CI Jenki ...

  2. Jenkins 流水线 获取git 分支列表_使用Jenkins Git参数实现分支标签动态选择

    1.1 为什么要使用GIT参数? 我们为什么要使用 git参数呢? 每个项目代码库都会有不同的分支,(如果你没有用多分支流水线的情况下)对于普通的流水线项目我们可以 让一条流水线来支持多个分支的发布, ...

  3. git 代码回退_「Vue 入门系列」第三期,适合新手入门的 Git 使用教程

    引言 Git 工具对于程序员来说已经不陌生了,在开发中也算是必不可少的工具了,本期我们就来看看如何利用 Git 管理代码,以及如何将代码提交到远程(线上) Github 仓库中. 主题:使用 Git ...

  4. vs2019中如何创建qt项目_在VS2015中创建Qt项目【VS+Qt项目开发系列】(二)

    在VS2015中创建Qt项目[VS+Qt项目开发系列](二) 发布时间:2018-04-20 22:44, 浏览次数:1269 , 标签: VS Qt 在上一篇[VS+Qt项目开发](一)在VS201 ...

  5. git jenkins 子目录_持续集成高级篇之Jenkins Pipeline git拉取

    PipeLine中拉取远程git仓库 前面讲自由式任务的时候,我们可以看到通过自由式job里提供的图形界面配置git拉取非常方便的,实际上使用PipeLine也并不复杂.这一节我们展示一下如何在Pip ...

  6. jenkins+python+git自动化测试框架_使用jenkins + python + selenium一步步搭建web自动化测试“框架”(1) - 各部件简介...

    原先搭建过一个自动化测试框架,迷迷糊糊不求甚解,算是搭建了一个仅限于能用的.根本算不上框架的玩意儿. 现在回过头来好好看看究竟每一步是怎么联系起来的,是怎么运行起来的. 本次博客先说说各部件都是干什么 ...

  7. Jenkins 流水线 获取git 分支列表_基于Jenkins的DevOps流水线实践课程

    讲师介绍 课程寄语 我认为Jenkins是对我这些年运维经验的总结,起初我们运维同学都是编写脚本完成一些自动化的操作.而有了Jenkins我们可以将我们的运维经验与Jenkins设计理念融合完成自动化 ...

  8. Jenkins 流水线 获取git 分支列表_基于Jenkins的DevOps流水线实践

    讲师介绍 课程寄语 我认为Jenkins是对我这些年运维经验的总结,起初我们运维同学都是编写脚本完成一些自动化的操作.而有了Jenkins我们可以将我们的运维经验与Jenkins设计理念融合完成自动化 ...

  9. Jenkins 流水线 获取git 分支列表_基于Jenkins的DevOps流水线实践教程

    讲师介绍 课程寄语 我认为Jenkins是对我这些年运维经验的总结,起初我们运维同学都是编写脚本完成一些自动化的操作.而有了Jenkins我们可以将我们的运维经验与Jenkins设计理念融合完成自动化 ...

  10. Jenkins 流水线 获取git 分支列表_基于Jenkins的DevOps流水线实践教程|2020全新制作|端到端研发效能提升...

    讲师介绍 课程寄语 我认为Jenkins是对我这些年运维经验的总结,起初我们运维同学都是编写脚本完成一些自动化的操作.而有了Jenkins我们可以将我们的运维经验与Jenkins设计理念融合完成自动化 ...

最新文章

  1. 项目新的需求,网页的自适应交付/响应式交付 Responsive/Adaptive Delivery
  2. 二胖写参数校验的坎坷之路
  3. 开源项目管理软件,团队协作配合新方式
  4. 著名数据库状告分支,法院:100%开源为虚假宣传!
  5. 并发操作的不一致性问题
  6. java不要在常量和变量中出现易混淆的字母
  7. idea install 失败_idea maven install 卡住,无报错排查。
  8. 转:Vim中显示不可见字符
  9. python读取dat文件代码-基于python批量处理dat文件及科学计算方法详解
  10. 信号与系统 第二版pdf 作者:奥本海姆 翻译:刘树棠
  11. OpenCV学习 之 IplImage*遍历每个像素点
  12. linux 64 输入法下载,搜狗输入法 for Linux
  13. 垃圾邮件分类系统python_【Python】基于Bayes算法的垃圾邮件分类系统
  14. nowcoder-第三届湖北省赛-Mr.Maxwell and attractions (贪心)
  15. 10M/100M自适应以太网接口
  16. hadoop清理回收站
  17. n(n-1)表示什么?n(-n)表示什么?
  18. zoom:1的清楚浮动原理?
  19. 烽火AN5516 OLT通过OMCI下发 PPPoE WAN连接问题分析-----OLT存在私有Me协议
  20. C# 富友支付回调验签

热门文章

  1. 9. Git flow
  2. 42.验证和授权(2)
  3. 61. Catalog 分类页面商品排序
  4. 《数学之美》—余弦定理和新闻的分类
  5. 问题:html控件中sleect的Option()的用法
  6. sping 总结(03)springmvc
  7. 计算机软件编程英语词汇集锦
  8. 把博客园的博客导出为MovableType的文本格式
  9. cssText 和 this
  10. 【Python】django安装