Плагин Git для решения проблемы с оформлением заказа в Хадсоне
Вопрос
При использовании плагина Git для Hudson моя работа всегда завершается неудачей при извлечении последних исходников из моего онлайн-репозитория 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?
Команда Git с ветвью, установленной в качестве master в конфигурации задания:
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)
Окружающая среда Гудзона: Debian Etch, Sun JSDK 6, git 1.4.4.4, hudson скачать последнюю стабильную версию
Решение
Во-первых, ваша версия Git довольно старая.Я предлагаю вам обновить его, прежде чем делать что-либо еще.
Второй, git checkout -f origin/
не является допустимой командой.Вам либо нужно оформить ветку, либо вы можете оформить фиксацию (указав хэш фиксации или тег) и одновременно создать новую ее ветку (используя git checkout -b new-branch commit-hash
).Смотрите на справочная страница git-оформления заказа для получения более подробной информации.