Domanda

Quando uso il plugin Git per Hudson il mio lavoro fallisce sempre quando recupero le ultime fonti dal mio repository git online (git: //github.com/ithena/orm2dsl.git).

Il plug-in git esegue prima git fetch correttamente. Quindi tenta di eseguire git checkout -f origin/, che non riesce come mostrato di seguito. È un problema con il mio repository git o è il comando di checkout che non ha senso?

Comando Git senza un ramo impostato nella configurazione del lavoro:

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?

Comando Git con branch impostato su master nella configurazione del lavoro:

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?

Uscita console 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)

Ambiente Hudson: Debian Etch, Sun JSDK 6, git 1.4.4.4, ultimo download stabile di hudson

È stato utile?

Soluzione

Innanzitutto, la tua versione di Git è piuttosto vecchia. Ti suggerisco di aggiornarlo prima di fare qualsiasi altra cosa.

Secondo, git checkout -f origin/ non è un comando valido. È necessario eseguire il checkout di un ramo oppure è possibile eseguire il checkout di un commit (specificando l'hash di commit o un tag) e crearne uno nuovo nello stesso (utilizzando git checkout -b new-branch commit-hash). Vedi la pagina man git-checkout per ulteriori dettagli.

Autorizzato sotto: CC-BY-SA insieme a attribuzione
Non affiliato a StackOverflow
scroll top