If the repository URL is http or https, I suspect that command line git
ignores the values of GIT_SSH and GIT_SSH_COMMAND.

If the repository URL is http or https, why not use the solution provided
at https://jenkins.io/doc/pipeline/examples/#push-git-repo (as noted by
Ivan earlier)?

If the repository URL is ssh, why not use the sshagent step instead of
using withCredentials?

On Fri, Mar 22, 2019 at 3:17 PM Robert Nicholson <[email protected]>
wrote:

> When I try to use
>
> withCredentials(....)
>         withEnv(‘GIT_SSH=doesnotexist’])
>              sh ‘git push origin —tags’
>
> For some reason the GIT_SSH seems to have no effect whatever.
>
> The git push doesn’t complain that way I would have expected
>
> But if I use
>
> withEnv(‘PATH=‘])
>     sh ‘git push origin —tags’
>
> That does have the intended affect of complaining about
> Git not being found in the path.
>
> Does anybody know why GIT_SSH nor GIT_SSH_COMMAND appear
> not work with git 2.16.2 like I’m trying?
>
> Sent from my iPad
>
> --
> 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 [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/jenkinsci-users/0566D01A-779B-416F-86DF-CDEF500A64D5%40gmail.com
> .
> For more options, visit https://groups.google.com/d/optout.
>


-- 
Thanks!
Mark Waite

-- 
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 [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jenkinsci-users/CAO49JtHws1t_-ibbUS663RkVxcbNnQRT7ZFky0GVHMgMZ%2B_%3DHg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to