Git push using jenkins credentials from declarative pipeline
问题 I'm using jenkins pipeline (declarative synthax) and I want to push a commit to my remote repository. Is there any way to accomplish this using the git plugin? Here is what I'm currently trying: withCredentials([usernamePassword(credentialsId: "${GIT_CREDENTIAL_ID}", passwordVariable: 'GIT_PASSWORD', usernameVariable: 'GIT_USERNAME')]) { sh "git add ${BRANCH_RENAME}.bundle" sh "echo ${GIT_USERNAME}|||||||${GIT_PASSWORD}" sh "git tag -a backup -m 'Backup branch ${BRANCH} from vega-salesforce