gpt4 book ai didi

Hudson checkout 问题的 Git 插件

转载 作者:太空狗 更新时间:2023-10-29 13:25:00 26 4
gpt4 key购买 nike

当使用 Hudson 的 Git 插件时,从我的在线 git 存储库 (git://github.com/ithena/orm2dsl.git) 获取最新资源时,我的工作总是失败。

git 插件首先成功执行git fetch。然后它尝试执行 git checkout -f origin/ ,它失败了,如下所示。这是my git repository的问题吗?还是没有意义的 checkout 命令?

在作业配置中没有设置分支的 Git 命令:

git checkout -f origin/
git checkout: updating paths is incompatible with switching branches/forcing
Did you intend to checkout 'origin/' which can not be resolved as commit?

在作业配置中将分支设置为 master 的 Git 命令:

git checkout -f origin/master
git checkout: updating paths is incompatible with switching branches/forcing
Did you intend to checkout 'origin/master' which can not be resolved as commit?

Hudson 控制台输出:

started
Checkout
[workspace] $ git fetch
Checking out origin/
[workspace] $ git checkout -f origin/
git checkout: updating paths is incompatible with switching branches/forcing
Did you intend to checkout 'origin/' which can not be resolved as commit?
FATAL: Error checking out origin/
java.lang.RuntimeException: Error checking out origin/
at hudson.plugins.git.GitAPI.launch(GitAPI.java:101)
at hudson.plugins.git.GitAPI.checkout(GitAPI.java:94)
at hudson.plugins.git.GitSCM.checkout(GitSCM.java:90)
at hudson.model.AbstractProject.checkout(AbstractProject.java:693)
at hudson.model.AbstractBuild$AbstractRunner.checkout(AbstractBuild.java:266)
at hudson.model.AbstractBuild$AbstractRunner.run(AbstractBuild.java:239)
at hudson.model.Run.run(Run.java:842)
at hudson.model.Build.run(Build.java:88)
at hudson.model.ResourceController.execute(ResourceController.java:70)
at hudson.model.Executor.run(Executor.java:90)

Hudson环境:Debian Etch,Sun JSDK 6,git 1.4.4.4,hudson最新稳定版下载

最佳答案

首先,您的 Git 版本太旧了。我建议您在执行任何其他操作之前更新它。

其次,git checkout -f origin/ 不是一个有效的命令。您要么需要 check out 一个分支,要么可以 check out 一个提交(通过指定提交哈希或标记)并同时创建它的一个新分支(使用 git checkout -b new-branch commit-hash)。查看git-checkout man page了解更多详情。

关于Hudson checkout 问题的 Git 插件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/499316/

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