git - Could not clone remote repository -


i have hudson running in red hat enterprise 5. in hudson, use git clone remote repository. error when cloning code:

cloning remote git repository cloning repository origin error: error cloning remote repo 'origin'  hudson.plugins.git.gitexception: not clone <repo url>     @ hudson.plugins.git.gitapi.clone(gitapi.java:241)     @ hudson.plugins.git.gitscm$3.invoke(gitscm.java:972)     @ hudson.plugins.git.gitscm$3.invoke(gitscm.java:919)     @ hudson.filepath.act(filepath.java:791)     @ hudson.filepath.act(filepath.java:773)     @ hudson.plugins.git.gitscm.gerrevisiontobuild(gitscm.java:919)     @ hudson.plugins.git.gitscm.checkout(gitscm.java:698)     @ hudson.model.abstractproject.checkout(abstractproject.java:1515)     @ hudson.model.abstractbuild$abstractrunner.checkout(abstractbuild.java:521)     @ hudson.model.abstractbuild$abstractrunner.run(abstractbuild.java:428)     @ hudson.model.run.run(run.java:1390)     @ hudson.model.freestylebuild.run(freestylebuild.java:40)     @ hudson.model.resourcecontroller.execute(resourcecontroller.java:82)     @ hudson.model.executor.run(executor.java:137) caused by: hudson.plugins.git.gitexception: org.eclipse.jgit.api.errors.transportexception: <repo   url>: not authorized     @ hudson.plugins.git.gitapi$1.invoke(gitapi.java:234)     @ hudson.plugins.git.gitapi$1.invoke(gitapi.java:221)     @ hudson.filepath.act(filepath.java:791)     @ hudson.filepath.act(filepath.java:773)     @ hudson.plugins.git.gitapi.clone(gitapi.java:221)     ... 13 more 

i see "not authorized" in trace above, guess may because haven't setup git account (username/password). searched every config in hudson's configure , job's configure couldn't find specify password. please me!

afaik, hudson runs separate user, while hudson tries clone something, search private key authenticate.

you should,

switch root

$sudo -i 

then switch hudson user

$su hudson 

generate ssh-key

$ssh-keygen -t rsa -c 'email_id_for_authentication' 

copy public key .ssh folder in ~hudson (hudson user's home folder)

add remote repository.

set user.email git in user hudosn

$git config --global user.email "email_id_for_authentication" 

you can same under git-plugin config in manage hudson > configure system


Comments

Popular posts from this blog

php - Calling a template part from a post -

Firefox SVG shape not printing when it has stroke -

How to mention the localhost in android -