5

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

git 插件首先git fetch成功执行。然后它尝试执行git checkout -f origin/,失败如下所示。这是我的 git 存储库的问题,还是 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?

哈德逊控制台输出:

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 最新稳定下载

4

1 回答 1

3

首先,您的 Git 版本相当旧。我建议您在执行任何其他操作之前对其进行更新。

第二,git checkout -f origin/不是一个有效的命令。您要么需要签出一个分支,要么您可以签出一个提交(通过指定提交哈希或标签)并同时创建一个新分支(使用git checkout -b new-branch commit-hash)。有关更多详细信息,请参阅git-checkout 手册页

于 2009-01-31T19:39:17.987 回答