-
Bug
-
Resolution: Not A Defect
-
Critical
Hi,
I am using username and password on Bitbucket url to clone my repository in Jenkins groovy file and code is below.
It is cloning successfully but it shows password in .git/config folder(inside workspace) and git revision history (in Jenkins run console).
I tried below commands to get rid off password display but it didn't work out.
sh 'git config user.email <email_address>'
sh 'git config user.name ${USER}'
sh 'git remote remove origin'
sh "git remote set-url ${gitUrl}"
and the final results looks like below:
code:
checkout([$class: 'GitSCM',
branches: [[name: 'develop']],
doGenerateSubmoduleConfigurations: false,
extensions: [[$class: 'LocalBranch', localBranch: "**"]],
gitTool: 'GIT_Latest_Version',
submoduleCfg: [],
userRemoteConfigs: [[url:
'https://\{username}:{password}@github.com/repo/repository.git']]])