Using the git command with credentials form a pipeline

34 views
Skip to first unread message

Nathan Hüsken

unread,
Sep 16, 2016, 4:34:17 PM9/16/16
to Jenkins Users
Hi,

I am trying to use git from a pipeline. For this I want to invoke git commands using "sh":

    sh('git clone https://myserver/project.git')

Some things I want to do require authentication.

When I use the GitSCM plugin (checkout([$class: 'GitSCM', ...), it tells me it uses GIT_ASKPASS for credentials.

Can I do that too? How would I have to configure GIT_ASKPASS for this to work?

Thanks!
Nathan

Mark Bidewell

unread,
Sep 17, 2016, 7:49:21 PM9/17/16
to Jenkins Users
I don't know if this helps or not but to use cmd line git in pipeline, I use the SSH Agent plugin along with SSH key authentication.
Reply all
Reply to author
Forward
0 new messages