The git step is a simplified shorthand for a subset of the more powerful checkout step:
{{checkout([$class: 'GitSCM', branches: [[name: '*/master']],
userRemoteConfigs: [[url: 'http://git-server/user/repository.git']]])}}
NOTE: The checkout step is the preferred SCM checkout method. It provides significantly more functionality than the git step.
Use the Pipeline Snippet Generator to generate a sample pipeline script for the checkout step.
The checkout step can be used in many cases where the git step cannot be used. Refer to the git plugin documentation for detailed descriptions of options available to the checkout step. For example, the git step does not support:
- SHA-1 checkout
- Tag checkout
- Submodule checkout
- Sparse checkout
- Large file checkout (LFS)
- Reference repositories
- Branch merges
- Repository tagging
- Custom refspecs
- Timeout configuration
- Changelog calculation against a non-default reference
- Stale branch pruning