If you update to the most recent version of git-client-plugin (1.0.5 or later), 
you don't need the "-D" setting, since command line git is the default in the 
latest git-client-plugin versions.

Regarding problem 1: I think it may be the old version of git you are running 
(1.6.0.2).  Refer to https://issues.jenkins-ci.org/browse/JENKINS-17629 for a 
more detailed description of why the problem is related to the git version.  
Git versions after 1.6.2 do not have the problem

Regarding problem 2: The git plugin advanced section has a "fast remote 
polling" setting.  I believe that if you enable that, then the plugin will use 
"git ls-remote" from the master node without performing the operation on the 
slave node.  You might check if the advanced configuration has fast remote 
polling enabled.  If it does and you are concerned about the overhead due to 
polling, you might read Kohsuke Kawaguchi's "Git polling must die" posting 
which describes how to improve the responsiveness of your jobs and reduce git 
polling significantly.

Mark Waite





>________________________________
> From: Sverre Moe <sve...@spacetec.no>
>To: jenkinsci-users@googlegroups.com 
>Sent: Wednesday, April 17, 2013 7:08 AM
>Subject: A couple of Git problems
> 
>
>
>I'm using Git with Jenkins and are having some problems.
>
>
>Have turned off JGit with -Dorg.jenkinsci.plugins.gitclient.Git.useJGit=false, 
>because otherwise it would not work.
>
>
>I'm using the following Git Url in my project settings: 
>ssh://g...@git.company.com/packages/companyApp.git
>
>
>Problem 1:
>Unable to perform git clone to workspace. This is because Jenkins 
>automatically creates the workspace directory. I have gone around this problem 
>by performing a manually git clonegit@git:/packages/companyApp into the 
>project workspace directory before I start my first build. I have read 
>somewhere that it was not recommended to clone the project into the workspace 
>directory, but I'm not sure how else to set it up.
>
>
>Started by user anonymous
>Building remotely on Build-2 in workspace 
>/home/build/jenkins/workspace/companyApp
>Checkout:companyApp / /home/build/jenkins/workspace/companyApp - 
>hudson.remoting.Channel@c0e349:Build-2
>Using strategy: Default
>selected Git installation does not exists. Using Default
>Last Built Revision: Revision b251d9ef240dbb3a2b4d18a16c67d65cb74d3de5 
>(origin/HEAD, origin/master)
>Cloning the remote Git repository
>Cloning repository ssh://g...@git.company.com/packages/companyApp.git
>git --version
>git version 1.6.0.2
>ERROR: Error cloning remote repo 'origin' : Could not clone 
>ssh://g...@git.company.com/packages/companyApp.git
>hudson.plugins.git.GitException: Could not clone 
>ssh://g...@git.company.com/packages/companyApp.git
>at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.clone(CliGitAPIImpl.java:219)
>at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:1001)
>at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:942)
>at hudson.FilePath$FileCallableWrapper.call(FilePath.java:2387)
>at hudson.remoting.UserRequest.perform(UserRequest.java:118)
>at hudson.remoting.UserRequest.perform(UserRequest.java:48)
>at hudson.remoting.Request$2.run(Request.java:326)
>at 
>hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
>at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
>at java.util.concurrent.FutureTask.run(FutureTask.java:166)
>at 
>java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
>at 
>java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
>at java.lang.Thread.run(Thread.java:722)
>Caused by: hudson.plugins.git.GitException: Command "git clone -o origin 
>ssh://g...@git.company.com/packages/companyApp.git/home/build/jenkins/workspace/companyApp"
> returned status code 128:
>stdout: 
>stderr: fatal: destination directory 
>'/home/build/jenkins/workspace/companyApp' already exists.
>
>at 
>org.jenkinsci.plugins.gitclient.CliGitAPIImpl.launchCommandIn(CliGitAPIImpl.java:773)
>at org.jenkinsci.plugins.gitclient.CliGitAPIImpl.clone(CliGitAPIImpl.java:217)
>... 12 more
>Trying next repository
>ERROR: Could not clone repository
>FATAL: Could not clone
>hudson.plugins.git.GitException: Could not clone
>at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:1013)
>at hudson.plugins.git.GitSCM$2.invoke(GitSCM.java:942)
>at hudson.FilePath$FileCallableWrapper.call(FilePath.java:2387)
>at hudson.remoting.UserRequest.perform(UserRequest.java:118)
>at hudson.remoting.UserRequest.perform(UserRequest.java:48)
>at hudson.remoting.Request$2.run(Request.java:326)
>at 
>hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
>at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)
>at java.util.concurrent.FutureTask.run(FutureTask.java:166)
>at 
>java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
>at 
>java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
>at java.lang.Thread.run(Thread.java:722)
> 
> 
>Problem 2:
>
>In project configure under the field for Git repository URL it gives the 
>following error message:
>
>Failed to connect to repository : Error performing command: git ls-remote -h 
>ssh://g...@git.company.com/packages/companyApp.git HEAD
>
>All I have supplied is the Git URL. The rest is default git settings for a 
>project (mostly empty).
>
> 
> 
>Jenkins runs this procject build on a slave node. This slave node is run with 
>user "build" and that user has access to g...@git.company.com (its public key 
>is on git.company.com). This is evident since I am able to manually clone the 
>project.
> 
> 
>/Sverre
>>________________________________
> CONFIDENTIALITY
This e-mail and any attachment contain KONGSBERG information which may be 
proprietary, confidential or subject to export regulations, and is only meant 
for the intended recipient(s). Any disclosure, copying, distribution or use is 
prohibited, if not otherwise explicitly agreed with KONGSBERG. If received in 
error, please delete it immediately from your system and notify the sender 
properly. 
>>________________________________
> 
-- 
>You received this message because you are subscribed to the Google Groups 
>"Jenkins Users" group.
>To unsubscribe from this group and stop receiving emails from it, send an 
>email to jenkinsci-users+unsubscr...@googlegroups.com.
>For more options, visit https://groups.google.com/groups/opt_out.
> 
> 
>
>
>

-- 
You received this message because you are subscribed to the Google Groups 
"Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to jenkinsci-users+unsubscr...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to