Andrian Durlestean Andrian Durlestean - 7 days ago 5
Git Question

Local Jenkins can't authenticate remote Gitlab private repository

I installed Jenkins on windows with all addons that I need, I think so. When i create a new job and in Repository URL i write my url

http://git.*****.org/*****/seleniumproject.git


and it shows

Help for feature: Repository URL
Failed to connect to repository : Command "C:\Program Files (x86)\Git\bin\git.exe ls-remote -h http://git.*****.org/*****/seleniumproject.git HEAD" returned status code 128:
stdout:
stderr: fatal: Authentication failed for 'http://git.*****.org/*****/seleniumproject.git'`


My question: how can I authenticate to my remote gitlab?! I have folder with .ssh with all keys but don't know what to do...

Update: strange because my TortoiseGit is working perfectly

My Fix :


  1. Go to jenkins path and save .ssh folder in root example
    C:\Jenkins\.ssh
    .ssh folder u can find in
    C:\Users\yourname\.ssh

  2. Go to Jenkins > Manage Jenkins > Manage Credentials, here you can
    add your private key or select from the jenkins master !/.ssh

  3. Go to Jenkins > Manage Jenkins > Configure System in git executable wrote this
    C:\Program Files (x86)\Git\cmd\git.exe
    path must be with cmd

  4. Create new job and in repository url add
    ssh://git@git.sitename.org:/name/projet.git


Answer

My Fix :

  1. Go to jenkins path and save .ssh folder in root example C:\Jenkins.ssh .ssh folder u can find in C:\Users\yourname.ssh
  2. Go to Jenkins > Manage Jenkins > Manage Credentials, here you can add your private key or select from the jenkins master !/.ssh
  3. Go to Jenkins > Manage Jenkins > Configure System in git executable wrote this C:\Program Files (x86)\Git\cmd\git.exe path must be with cmd
  4. Create new job and in repository url add ssh://git@git.sitename.org:/name/projet.git
Comments