Challenge - 5 Problems
Git Plugin Mastery
Get all challenges correct to earn this badge!
Test your skills under time pressure!
💻 Command Output
intermediate2:00remaining
Git plugin: What is the output of this Jenkins pipeline snippet?
Consider this Jenkins pipeline snippet using the Git plugin to clone a repository. What will be the output in the Jenkins console after running this?
Jenkins
pipeline {
agent any
stages {
stage('Clone') {
steps {
git url: 'https://github.com/example/repo.git', branch: 'main'
}
}
}
}Attempts:
2 left
💡 Hint
The branch specified is 'main', so the checkout will be for 'main'.
✗ Incorrect
The git step clones the repository URL and checks out the specified branch 'main'. The output shows cloning and checking out 'main' branch with success.
❓ Configuration
intermediate2:00remaining
Git plugin: Which configuration snippet correctly sets credentials for private repo access?
You want Jenkins to clone a private Git repository using stored credentials. Which configuration snippet correctly sets the credentials ID in the Git plugin step?
Attempts:
2 left
💡 Hint
The Git plugin expects the exact parameter name for credentials.
✗ Incorrect
The correct parameter name is 'credentialsId' to specify stored credentials for Git plugin in Jenkins.
❓ Troubleshoot
advanced2:00remaining
Git plugin: Why does this Jenkins job fail with 'Could not resolve host' error?
A Jenkins job using the Git plugin fails with this error: 'fatal: unable to access 'https://github.com/example/repo.git/': Could not resolve host: github.com'. What is the most likely cause?
Attempts:
2 left
💡 Hint
The error indicates a network or DNS problem.
✗ Incorrect
The error 'Could not resolve host' means Jenkins cannot find the github.com server, usually due to network or DNS issues.
🔀 Workflow
advanced2:00remaining
Git plugin: What is the correct order of steps to configure a Jenkins job to poll Git changes?
Arrange these steps in the correct order to configure a Jenkins freestyle job to poll a Git repository for changes.
Attempts:
2 left
💡 Hint
You must first define the repo and credentials before enabling polling.
✗ Incorrect
First add repo URL, then credentials if needed, then enable polling, then set schedule.
✅ Best Practice
expert2:00remaining
Git plugin: Which practice ensures secure and maintainable Jenkins Git configurations?
Which of the following is the best practice when configuring Git plugin in Jenkins for multiple jobs accessing private repositories?
Attempts:
2 left
💡 Hint
Centralized credential management improves security and ease of updates.
✗ Incorrect
Storing credentials centrally and referencing by ID avoids duplication and improves security.