We have a build job which runs on a linux OS and does a checkout of our code prior to packaging it, the problem we're having is that when its checking out the code, it appears the EOF is being set to LR, where we want it to preserve the windows CR LF.
Is it possible to force it to check out the code with the EOF windows format CRLF as part of the pipeline code?
Ive tried running git config --global core.autocrlf true locally, prior to doing a checkout (on a linux os) and this does work, but when we do the same within our pipeline it doesn't seem to be taking effect.
stages {
stage ("CHECKOUT") {
steps {
script {
sh """
echo "Setting core.autocrlf true value"
git config --global core.autocrlf true
"""
}
// Clean workspace
deleteDir()
// Checkout the code
checkout([$class: 'GitSCM',
branches: [[name: commitId]],
doGenerateSubmoduleConfigurations: false,
extensions: [[$class: 'GitLFSPull']],
submoduleCfg: [],
userRemoteConfigs: [[credentialsId: 'bitbucket_credentials', url: 'URL TO REPO']]]
)
}
}
Do i need to set this config as part of the checkout GitSCM class somehow?
Many thanks