gpt4 book ai didi

git - Jenkins :更新子模块时,使用子模块的最新提交重建主存储库

转载 作者:行者123 更新时间:2023-12-05 08:01:29 24 4
gpt4 key购买 nike

能否请您帮助我处理 jenkins 中的工作流程。我们有带有子模块 s1 的主存储库 rep1。子模块已添加到具有特定提交编号的 rep1。我们经常 promise s1。但是 jenkins 在更新 rep1 时没有看到新的变化,因为 s1 有旧的提交号。

当其他开发人员更新 s1 时,我们如何配置 jenkins 以使用 s1 的最新更改自动重建 rep1?

最佳答案

当您提交 s1 时,您需要确保将指针更新为 r1 中正确的提交散列并推送,否则 r1 仍指向旧版本的 s1。

例子:

~/r1 <---- main project
~/r1/s1 <---- submodule in your project

< 对 s1 进行更改 >

# you commit your changes for whatever
~/r1/s1: git commit -am 'major commit not doing single adds'

现在,切换回 ~/r1

~/r1: git add ./s1
~/r1: git commit -m 'updating pointer for submodule in changes in s1'

现在,当您推送更改时,jenkins 会看到您告诉它您更新了主存储库中的指针,并且您需要进行全新的重建(假设 jenkins 将对 r1 上的任何更新进行重建)。

关于git - Jenkins :更新子模块时,使用子模块的最新提交重建主存储库,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/13641400/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com