gpt4 book ai didi

git - Jenkins 和 Git 子模块的问题

转载 作者:行者123 更新时间:2023-12-04 03:11:33 25 4
gpt4 key购买 nike

我试图让 Jenkins 在 Windows PC 上工作,并发现子模块存在一个奇怪的问题。

我有一个带有三个子模块的 git repo。过了一会儿,我似乎让 Git 自己在 Jenkins 上工作,所以正常的克隆工作。但是克隆不会克隆主仓库中的子模块,所以我选中了该框以递归更新子模块。

enter image description here

但是,当我运行我的工作时:

Started by user <User>
Building in workspace X:\Jenkins\<JobName>
- C:/Program Files/Git/bin/git.exe rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
- C:/Program Files/Git/bin/git.exe config remote.origin.url ssh://git@<server>/<repo>.git # timeout=10
Fetching upstream changes from ssh://git@<server>/<repo>.git
- C:/Program Files/Git/bin/git.exe --version # timeout=10
using GIT_SSH to set credentials
- C:/Program Files/Git/bin/git.exe fetch --tags --progress ssh://git@<server>/<repo>.git +refs/heads/*:refs/remotes/origin/*
- C:/Program Files/Git/bin/git.exe rev-parse "refs/remotes/origin/master^{commit}" # timeout=10
- C:/Program Files/Git/bin/git.exe rev-parse "refs/remotes/origin/origin/master^{commit}" # timeout=10
Checking out Revision b13204ee1c6717a82d1c7a17922f2a477efd119d (refs/remotes/origin/master)
Commit message: "testinggg.."
- C:/Program Files/Git/bin/git.exe config core.sparsecheckout # timeout=10
- C:/Program Files/Git/bin/git.exe checkout -f b13204ee1c6717a82d1c7a17922f2a477efd119d
- C:/Program Files/Git/bin/git.exe rev-list b13204ee1c6717a82d1c7a17922f2a477efd119d # timeout=10
- C:/Program Files/Git/bin/git.exe remote # timeout=10
- C:/Program Files/Git/bin/git.exe submodule init # timeout=10
- C:/Program Files/Git/bin/git.exe submodule sync # timeout=10
- C:/Program Files/Git/bin/git.exe config --get remote.origin.url # timeout=10
- C:/Program Files/Git/bin/git.exe submodule init # timeout=10
- C:/Program Files/Git/bin/git.exe config -f .gitmodules --get-regexp ^submodule\.(.*)\.url # timeout=10
- C:/Program Files/Git/bin/git.exe config --get submodule.top.url # timeout=10
- C:/Program Files/Git/bin/git.exe remote # timeout=10
- C:/Program Files/Git/bin/git.exe config --get remote.origin.url # timeout=10
- C:/Program Files/Git/bin/git.exe config -f .gitmodules --get submodule.top.path # timeout=10
using GIT_SSH to set credentials
- C:/Program Files/Git/bin/git.exe submodule update --init --recursive top
FATAL: Command "C:/Program Files/Git/bin/git.exe submodule update --init --recursive top" returned status code 1:
stdout:
stderr: fatal: Needed a single revision
Unable to find current revision in submodule path 'top'

hudson.plugins.git.GitException: Command "C:/Program Files/Git/bin/git.exe submodule update --init --recursive top" returned status code 1:
stdout:
stderr: fatal: Needed a single revision
Unable to find current revision in submodule path 'top'

at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:1903)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandWithCredentials(CliGitAPIImpl.java:1622)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.access$300(CliGitAPIImpl.java:71)
at org.jenkinsci.plugins.gitclient.CliGitAPIImpl$7.execute(CliGitAPIImpl.java:1076)
at hudson.plugins.git.extensions.impl.SubmoduleOption.onCheckoutCompleted(SubmoduleOption.java:102)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:1182)
at hudson.scm.SCM.checkout(SCM.java:495)
at hudson.model.AbstractProject.checkout(AbstractProject.java:1276)
at hudson.model.AbstractBuild$AbstractBuildExecution.defaultCheckout(AbstractBuild.java:560)
at jenkins.scm.SCMCheckoutStrategy.checkout(SCMCheckoutStrategy.java:86)
at hudson.model.AbstractBuild$AbstractBuildExecution.run(AbstractBuild.java:485)
at hudson.model.Run.execute(Run.java:1735)
at hudson.model.FreeStyleBuild.run(FreeStyleBuild.java:43)
at hudson.model.ResourceController.execute(ResourceController.java:97)
at hudson.model.Executor.run(Executor.java:405)
Finished: FAILURE

当 Git 说:

Needed a single revision Unable to find current revision in submodule path 'top'



我环顾四周,一无所获:(

我已经在普通 shell 上复制了这个命令序列,没有出现错误。

任何帮助将不胜感激。谢谢!

最佳答案

对于遇到类似问题的任何人,请选中 Jenkins 以清除本地工作区并强制存储库克隆一次。这对我有用;)

关于git - Jenkins 和 Git 子模块的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44914057/

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