0
0
Jenkinsdevops~10 mins

Git plugin configuration in Jenkins - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to specify the Git repository URL in Jenkins pipeline.

Jenkins
git url: '[1]'
Drag options to blanks, or click blank then click option'
Arepo.git
Bgit@github.com:example/repo.git
Chttps://github.com/example/repo.git
Dhttp://example.com/repo
Attempts:
3 left
💡 Hint
Common Mistakes
Using a partial URL or missing https:// prefix
Using SSH URL when HTTPS is expected
2fill in blank
medium

Complete the code to specify the branch name to checkout in Jenkins Git plugin.

Jenkins
branch: '[1]'
Drag options to blanks, or click blank then click option'
Amaster
Bmain
Cdevelop
Dfeature
Attempts:
3 left
💡 Hint
Common Mistakes
Using a branch name that does not exist in the repo
Leaving branch name empty
3fill in blank
hard

Fix the error in the Jenkins pipeline Git checkout step by completing the missing keyword.

Jenkins
checkout scm: [1]
Drag options to blanks, or click blank then click option'
A[$class: 'GitSCM', branch: 'master', url: 'https://github.com/example/repo.git']
B[$class: 'GitSCM', branches: ['master'], url: 'https://github.com/example/repo.git']
C[$class: 'Git', branches: [[name: 'master']], userRemoteConfigs: [[url: 'https://github.com/example/repo.git']]]
D[$class: 'GitSCM', branches: [[name: 'refs/heads/master']], userRemoteConfigs: [[url: 'https://github.com/example/repo.git']]]
Attempts:
3 left
💡 Hint
Common Mistakes
Using wrong class name
Incorrect branches format
Missing userRemoteConfigs
4fill in blank
hard

Fill both blanks to configure credentials and repository URL in Jenkins Git plugin.

Jenkins
git url: '[1]', credentialsId: '[2]'
Drag options to blanks, or click blank then click option'
Ahttps://github.com/example/repo.git
Bgit-credentials-id
Cssh-credentials-id
Dhttps://gitlab.com/example/repo.git
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing SSH URL with HTTPS credentials
Using wrong credentials ID
5fill in blank
hard

Fill all three blanks to create a Jenkins pipeline Git checkout step with branch, credentials, and repository URL.

Jenkins
checkout([$class: 'GitSCM', branches: [[name: '[1]']], userRemoteConfigs: [[url: '[2]', credentialsId: '[3]']]])
Drag options to blanks, or click blank then click option'
Arefs/heads/main
Bhttps://github.com/example/repo.git
Cgit-credentials-id
Drefs/heads/develop
Attempts:
3 left
💡 Hint
Common Mistakes
Using short branch names without refs/heads/
Wrong URL format
Incorrect credentials ID