The following plugin provides functionality available through Pipeline-compatible steps. Read more about how to integrate steps into your Pipeline in the Steps section of the Pipeline Syntax page.

For a list of other such plugins, see the Pipeline Steps Reference page.

$class: 'BacklogPullRequestSCMSource'

  • $class: 'BacklogPullRequestSCMSource'
    • remote : String
    • credentialsId : String
    • includes : String
    • excludes : String
    • ignoreOnPushNotifications : boolean
    • url : String
      Set the project URL of Backlog used with this repository. Samples of URL are shown below.
      • https://demo.backlog.jp/projects/DORA
    • apiKey : String

      API key when using Backlog API version 2.

    • id : String (optional)
    • browser (optional)
        Nested Choice of Objects
      • assembla
        • repoUrl : String
          Specify the root URL serving this repository (such as https://www.assembla.com/code/PROJECT/git/).
      • $class: 'BacklogGitRepositoryBrowser'
        • repoName : String
        • repoUrl : String
      • bitbucketServer
        • repoUrl : String
          Specify the Bitbucket Server root URL for this repository (such as https://bitbucket:7990/OWNER/REPO/).
      • bitbucket
        • repoUrl : String
          Specify the root URL serving this repository (such as https://bitbucket.org/OWNER/REPO/).
      • cgit
        • repoUrl : String
          Specify the root URL serving this repository (such as https://cgit.example.com:port/group/REPO/).
      • fisheye
        • repoUrl : String
          Specify the URL of this repository in FishEye (such as https://fisheye.example.com/browse/project/).
      • gitblit
        • repoUrl : String
          Specify the root URL serving this repository.
        • projectName : String
          Specify the name of the project in GitBlit.
      • $class: 'GitBucketBrowser'
        • url : String
      • gitLab
        • repoUrl : String
          Specify the root URL serving this repository (such as https://gitlab.com/username/repository/).
        • version : String (optional)
          Specify the major and minor version of GitLab you use (such as 9.1). If you don't specify a version, a modern version of GitLab (>= 8.0) is assumed.
      • gitLabBrowser
        Specify the HTTP URL for this project's GitLab page so that links to changes can be automatically generated by Jenkins. The URL needs to include the owner and project. If the GitLab server is https://gitLab.example.com then the URL for bob's skunkworks project might be https://gitLab.example.com/bob/skunkworks.
        • projectUrl : String
          Specify the HTTP URL for this project's GitLab page. The URL needs to include the owner and project so, for example, if the GitLab server is https://gitLab.example.com then the URL for bob's skunkworks project might be https://gitLab.example.com/bob/skunkworks
      • gitList
        • repoUrl : String
          Specify the root URL serving this repository (such as https://gitlist.example.com/repo/).
      • gitWeb
        • repoUrl : String
          Specify the root URL serving this repository (such as https://github.com/jenkinsci/jenkins.git).
      • $class: 'GiteaBrowser'
        • repoUrl : String
          Specify the HTTP URL for this repository's Gitea page. The URL needs to include the owner and repository so, for example, if the Gitea server is https://gitea.example.com then the URL for bob's skunkworks project repository might be https://gitea.example.com/bob/skunkworks
      • github
        • repoUrl : String
          Specify the HTTP URL for this repository's GitHub page (such as https://github.com/jquery/jquery).
      • gitiles
        • repoUrl : String
          Specify the root URL serving this repository (such as https://gwt.googlesource.com/gwt/).
      • $class: 'GitoriousWeb'
        • repoUrl : String
          Specify the root URL serving this repository (such as https://gitorious.org/gitorious/mainline).
      • gogs
        • repoUrl : String
          Specify the root URL serving this repository (such as https://gogs.example.com/username/some-repo-url.git).
      • kiln
        • repoUrl : String
          Specify the root URL serving this repository (such as https://khanacademy.kilnhg.com/Code/Website/Group/webapp).
      • phabricator
        • repoUrl : String
          Specify the phabricator instance root URL (such as https://phabricator.example.com).
        • repo : String
          Specify the repository name in phabricator (such as the foo part of phabricator.example.com/diffusion/foo/browse).
      • redmine
        • repoUrl : String
          Specify the root URL serving this repository (such as https://redmine.example.com/PATH/projects/PROJECT/repository).
      • rhodeCode
        • repoUrl : String
          Specify the HTTP URL for this repository's RhodeCode page (such as https://rhodecode.example.com/projects/PROJECT/repos/REPO/).
      • $class: 'ScmManagerGitRepositoryBrowser'
        • repoUrl : String
          Specify the root URL serving this repository (such as https://scm-manager.org/scm/repo/namespace/name).
      • jbSpace
        • repoUrl : String
          Provide the absolute URL to your repository in JetBrains SpaceCode in the following format: https://<your SpaceCode instance>/p/<project key>/repositories/<repository name>
      • $class: 'Stash'
        • repoUrl : String
          Specify the HTTP URL for this repository's Stash page (such as https://stash.example.com/projects/PROJECT/repos/REPO/).
      • $class: 'TracGitRepositoryBrowser'
        • $class: 'TuleapBrowser'
          Specify the HTTPS URL for the Tuleap Git repository so that links to changes can be automatically generated by Jenkins.
          • repositoryUrl : String
            The URL is the web URL of the Tuleap Git repository.
        • viewgit
          • repoUrl : String
            Specify the root URL serving this repository (such as https://git.example.com/viewgit/).
          • projectName : String
            Specify the name of the project in ViewGit (e.g. scripts, scuttle etc. from https://code.fealdia.org/viewgit/).
      • extensions (optional)
          Array / List of Nested Choice of Objects
        • authorInChangelog
          The default behavior is to use the Git commit's "Committer" value in Jenkins' build changesets. If this option is selected, the Git commit's "Author" value would be used instead.
          • $class: 'BuildChooserSetting'
            When you are interested in using a job to build multiple heads (most typically multiple branches), you can choose how Jenkins choose what branches to build in what order.

            This extension point in Jenkins is used by many other plugins to control the job to build specific commits. When you activate those plugins, you may see them installing a custom strategy here.

            • buildChooser
                Nested Choice of Objects
              • $class: 'AlternativeBuildChooser'
                • $class: 'AncestryBuildChooser'
                  • maximumAgeInDays : int
                  • ancestorCommitSha1 : String
                • $class: 'DefaultBuildChooser'
                  • $class: 'DeflakeGitBuildChooser'
                    • $class: 'GerritTriggerBuildChooser'
                      • $class: 'InverseBuildChooser'
                    • buildSingleRevisionOnly
                      Disable scheduling for multiple candidate revisions.
                      If we have 3 branches:
                      ----A--.---.--- B
                               \-----C
                      jenkins would try to build (B) and (C).
                      This behaviour disables this and only builds one of them.
                      It is helpful to reduce the load of the Jenkins infrastructure when the SCM system like Bitbucket or GitHub should decide what commits to build.
                      • changelogToBranch
                        This method calculates the changelog against the specified branch.
                        • options
                            Nested Object
                          • compareRemote : String
                            Name of the repository, such as origin, that contains the branch you specify below.
                          • compareTarget : String
                            The name of the branch within the named repository to compare against.
                      • checkoutOption
                        • timeout : int
                          Specify a timeout (in minutes) for checkout.
                          This option overrides the default timeout of 10 minutes.
                          You can change the global git timeout via the property org.jenkinsci.plugins.gitclient.Git.timeOut (see JENKINS-11286). Note that property should be set on both controller and agent to have effect (see JENKINS-22547).
                      • cleanBeforeCheckout
                        Clean up the workspace before every checkout by deleting all untracked files and directories, including those which are specified in .gitignore. It also resets all tracked files to their versioned state. This ensures that the workspace is in the same state as if you cloned and checked out in a brand-new empty directory, and ensures that your build is not affected by the files generated by the previous build.
                        • deleteUntrackedNestedRepositories : boolean (optional)
                          Deletes untracked submodules and any other subdirectories which contain .git directories.
                      • cleanAfterCheckout
                        Clean up the workspace after every checkout by deleting all untracked files and directories, including those which are specified in .gitignore. It also resets all tracked files to their versioned state. This ensures that the workspace is in the same state as if you cloned and checked out in a brand-new empty directory, and ensures that your build is not affected by the files generated by the previous build.
                        • deleteUntrackedNestedRepositories : boolean (optional)
                          Deletes untracked submodules and any other subdirectories which contain .git directories.
                      • cloneOption
                        • shallow : boolean
                          Perform shallow clone, so that git will not download the history of the project, saving time and disk space when you just want to access the latest version of a repository.
                        • noTags : boolean
                          Deselect this to perform a clone without tags, saving time and disk space when you just want to access what is specified by the refspec.
                        • reference : String
                          Specify a folder containing a repository that will be used by Git as a reference during clone operations.
                          This option will be ignored if the folder is not available on the controller or agent where the clone is being executed.
                        • timeout : int
                          Specify a timeout (in minutes) for clone and fetch operations.
                          This option overrides the default timeout of 10 minutes.
                          You can change the global git timeout via the property org.jenkinsci.plugins.gitclient.Git.timeOut (see JENKINS-11286). Note that property should be set on both controller and agent to have effect (see JENKINS-22547).
                        • depth : int (optional)
                          Set shallow clone depth, so that git will only download recent history of the project, saving time and disk space when you just want to access the latest commits of a repository.
                        • honorRefspec : boolean (optional)
                          Perform initial clone using the refspec defined for the repository. This can save time, data transfer and disk space when you only need to access the references specified by the refspec.
                      • $class: 'CodeCommitURLHelper'
                        • credentialId : String

                          OPTIONAL: Select the credentials to use.
                          If not specified, defaults to the DefaultAWSCredentialsProviderChain behaviour - *FROM THE JENKINS INSTANCE*

                          In the latter case, usage of IAM Role Profiles seems not to work, thus relying on environment variables / system properties or the ~/.aws/credentials file, thus not recommended.

                        • repositoryName : String
                      • $class: 'DisableRemotePoll'
                        Git plugin uses git ls-remote polling mechanism by default when configured with a single branch (no wildcards!). This compare the latest built commit SHA with the remote branch without cloning a local copy of the repo.

                        If you don't want to / can't use this.

                        If this option is selected, polling will require a workspace and might trigger unwanted builds (see JENKINS-10131).
                        • $class: 'ExcludeFromChangeSet'
                          • $class: 'ExcludeFromPoll'
                            • firstBuildChangelog
                              First builds will populate the changelog with the latest commit, if any, to allow Pipelines to check and test for file changes. By default, no changelog is generated for the first build because the first build has no predecessor build for comparison. When the first build changelog option is enabled, the most recent commit on the branch will be used as the changelog of the first build.
                              • makeChangelog : boolean (optional)
                            • lfs
                              Enable git large file support for the workspace by pulling large files after the checkout completes. Requires that the controller and each agent performing an LFS checkout have installed `git lfs`.
                              • $class: 'GitSCMChecksExtension'
                                • verboseConsoleLog : boolean (optional)
                                  If this option is checked, verbose log will be output to build console; the verbose log is useful for debugging the publisher creation.
                              • $class: 'GitSCMStatusChecksExtension'
                                • name : String (optional)
                                • skip : boolean (optional)
                                • skipProgressUpdates : boolean (optional)
                                • suppressLogs : boolean (optional)
                                • unstableBuildNeutral : boolean (optional)
                              • $class: 'GitTagMessageExtension'
                                If the revision checked out has a git tag associated with it, the tag name will be exported during the build as GIT_TAG_NAME.
                                If a message was specified when creating the tag, then that message will be exported during the build as the GIT_TAG_MESSAGE environment variable.
                                If no tag message was specified, the commit message will be used.
                                If you ticked the Use most recent tag option, and the revision checked out has no git tag associated with it, the parent commits will be searched for a git tag, and the rules stated above will apply to the first parent commit with a git tag.

                                If the revision has more than one tag associated with it, only the most recent tag will be taken into account, unless the refspec contains "refs/tags/" — i.e. builds are only triggered when certain tag names or patterns are matched — in which case the exact tag name that triggered the build will be used, even if it's not the most recent tag for this commit.
                                For this reason, if you're not using a tag-specific refspec but you are using the "Create a tag for every build" behaviour, you should make sure that the build-tagging behaviour is configured to run after this "export git tag message" behaviour.

                                Tag and commit messages which span multiple lines are no problem, though only the first 10000 lines of a tag's message will be exported.
                                • useMostRecentTag : boolean (optional)
                              • $class: 'IgnoreNotifyCommit'
                                If checked, this repository will be ignored when the notifyCommit-URL is accessed regardless of if the repository matches or not.
                                • localBranch
                                  If given, checkout the revision to build as HEAD on this branch.

                                  If selected, and its value is an empty string or "**", then the branch name is computed from the remote branch without the origin. In that case, a remote branch origin/master will be checked out to a local branch named master, and a remote branch origin/develop/new-feature will be checked out to a local branch named develop/newfeature.

                                  Please note that this has not been tested with submodules.

                                  • localBranch : String
                                • $class: 'MessageExclusion'
                                  • excludedMessage : String
                                    If set, and Jenkins is set to poll for changes, Jenkins will ignore any revisions committed with message matched to Pattern when determining if a build needs to be triggered. This can be used to exclude commits done by the build itself from triggering another build, assuming the build server commits the change with a distinct message.

                                    Exclusion uses Pattern matching

                                    .*\[maven-release-plugin\].*
                                    The example above illustrates that if only revisions with "[maven-release-plugin]" message in first comment line have been committed to the SCM a build will not occur.

                                    You can create more complex patterns using embedded flag expressions.
                                    (?s).*FOO.*
                                    This example will search FOO message in all comment lines.
                                • $class: 'PathRestriction'
                                  If set, and Jenkins is set to poll for changes, Jenkins will pay attention to included and/or excluded files and/or folders when determining if a build needs to be triggered.

                                  Using this behaviour will preclude the faster git ls-remote polling mechanism, forcing polling to require a workspace thus sometimes triggering unwanted builds, as if you had selected the Force polling using workspace extension as well.
                                  • includedRegions : String
                                    Each inclusion uses java regular expression pattern matching, and must be separated by a new line. An empty list implies that everything is included.

                                        myapp/src/main/web/.*\.html
                                        myapp/src/main/web/.*\.jpeg
                                        myapp/src/main/web/.*\.gif
                                      
                                    The example above illustrates that a build will only occur, if html/jpeg/gif files have been committed to the SCM. Exclusions take precedence over inclusions, if there is an overlap between included and excluded regions.
                                  • excludedRegions : String
                                    Each exclusion uses java regular expression pattern matching, and must be separated by a new line.

                                        myapp/src/main/web/.*\.html
                                        myapp/src/main/web/.*\.jpeg
                                        myapp/src/main/web/.*\.gif
                                      
                                    The example above illustrates that if only html/jpeg/gif files have been committed to the SCM a build will not occur.
                                • perBuildTag
                                  Create a tag in the workspace for every build to unambiguously mark the commit that was built. You can combine this with Git publisher to push the tags to the remote repository.
                                  • $class: 'PreBuildMerge'
                                    These options allow you to perform a merge to a particular branch before building. For example, you could specify an integration branch to be built, and to merge to master. In this scenario, on every change of integration, Jenkins will perform a merge with the master branch, and try to perform a build if the merge is successful. It then may push the merge back to the remote repository if the Git Push post-build action is selected.
                                    • options
                                        Nested Object
                                      • mergeTarget : String
                                        The name of the branch within the named repository to merge to, such as master.
                                      • fastForwardMode (optional)
                                        Merge fast-forward mode selection.
                                        The default, --ff, gracefully falls back to a merge commit when required.
                                        For more information, see the Git Merge Documentation
                                        • Values: FF, FF_ONLY, NO_FF
                                      • mergeRemote : String (optional)
                                        Name of the repository, such as origin, that contains the branch you specify below. If left blank, it'll default to the name of the first repository configured above.
                                      • mergeStrategy (optional)
                                        Merge strategy selection. This feature is not fully implemented in JGIT.
                                        • Values: DEFAULT, RESOLVE, RECURSIVE, OCTOPUS, OURS, SUBTREE, RECURSIVE_THEIRS
                                  • pretestedIntegration
                                    • gitIntegrationStrategy
                                        Nested Choice of Objects
                                      • accumulated

                                        Accumulated Commit Strategy

                                        This strategy merges your commits with the --no-ff switch
                                        • shortCommitMessage : boolean (optional)
                                      • ffonly

                                        Fast Forward only (--ff-only) Strategy

                                        This strategy fast-forward only using the --ff-only switch - or fails
                                        • shortCommitMessage : boolean (optional)
                                      • squash

                                        Squashed Commit Strategy

                                        This strategy squashes all your commit on a given branch with the --squash option
                                      • integrationBranch : String

                                        What to specify

                                        The branch name must match your integration branch name. No trailing slash.

                                        Merge is performed the following way

                                        Squash commit
                                                    git checkout -B <Branch name> <Repository name>/<Branch name>
                                                    git merge --squash <Branch matched by git>
                                                    git commit -C <Branch matched by git>
                                        Accumulated commit
                                                    git checkout -B <Branch name> <Repository name>/<Branch name>
                                                    git merge -m <commitMsg> <Branch matched by git> --no-ff

                                        When changes are pushed to the integration branch?

                                        Changes are only ever pushed when the build results is SUCCESS

                                                    git push <Repository name> <Branch name>
                                      • repoName : String

                                        What to specify

                                        The repository name. In git the repository is always the name of the remote. So if you have specified a repository name in your Git configuration. You need to specify the exact same name here, otherwise no integration will be performed. We do the merge based on this.

                                        No trailing slash on repository name.

                                        Remember to specify this when working with NAMED repositories in Git

                                    • pruneStaleBranch
                                      Run "git remote prune" for each remote, to prune obsolete local branches.
                                      • pruneTags
                                        • pruneTags : boolean
                                      • $class: 'RelativeTargetDirectory'
                                        • relativeTargetDir : String
                                          Specify a local directory (relative to the workspace root) where the Git repository will be checked out. If left empty, the workspace root itself will be used.

                                          This extension should not be used in Jenkins Pipeline (either declarative or scripted). Jenkins Pipeline already provides standard techniques for checkout to a subdirectory. Use ws and dir in Jenkins Pipeline rather than this extension.

                                      • $class: 'ScmName'

                                        Unique name for this SCM. Needed when using Git within the Multi SCM plugin.

                                        • name : String
                                      • sparseCheckout

                                        Specify the paths that you'd like to sparse checkout. This may be used for saving space (Think about a reference repository). Be sure to use a recent version of Git, at least above 1.7.10

                                        • sparseCheckoutPaths
                                            Array / List of Nested Object
                                          • path : String
                                      • submodule
                                        • depth : int (optional)
                                          Set shallow clone depth, so that git will only download recent history of the project, saving time and disk space when you just want to access the latest commits of a repository.
                                        • disableSubmodules : boolean (optional)
                                          By disabling support for submodules you can still keep using basic git plugin functionality and just have Jenkins to ignore submodules completely as if they didn't exist.
                                        • parentCredentials : boolean (optional)
                                          Use credentials from the default remote of the parent project.
                                        • recursiveSubmodules : boolean (optional)
                                          Retrieve all submodules recursively (uses '--recursive' option which requires git>=1.6.5)
                                        • reference : String (optional)
                                          Specify a folder containing a repository that will be used by Git as a reference during clone operations.
                                          This option will be ignored if the folder is not available on the controller or agent where the clone is being executed.
                                          To prepare a reference folder with multiple subprojects, create a bare git repository and add all the remote urls then perform a fetch:
                                            git init --bare
                                            git remote add SubProject1 https://gitrepo.com/subproject1
                                            git remote add SubProject2 https://gitrepo.com/subproject2
                                            git fetch --all
                                            
                                        • shallow : boolean (optional)
                                          Perform shallow clone, so that git will not download the history of the project, saving time and disk space when you just want to access the latest version of a repository.
                                        • threads : int (optional)
                                          Specify the number of threads that will be used to update submodules.
                                          If unspecified, the command line git default thread count is used.
                                        • timeout : int (optional)
                                          Specify a timeout (in minutes) for submodules operations.
                                          This option overrides the default timeout of 10 minutes.
                                          You can change the global git timeout via the property org.jenkinsci.plugins.gitclient.Git.timeOut (see JENKINS-11286). Note that property should be set on both controller and agent to have effect (see JENKINS-22547).
                                        • trackingSubmodules : boolean (optional)
                                          Retrieve the tip of the configured branch in .gitmodules (Uses '--remote' option which requires git>=1.8.2)
                                      • $class: 'UserExclusion'
                                        • excludedUsers : String
                                          If set, and Jenkins is set to poll for changes, Jenkins will ignore any revisions committed by users in this list when determining if a build needs to be triggered. This can be used to exclude commits done by the build itself from triggering another build, assuming the build server commits the change with a distinct SCM user.

                                          Using this behaviour will preclude the faster git ls-remote polling mechanism, forcing polling to require a workspace thus sometimes triggering unwanted builds, as if you had selected the Force polling using workspace extension as well.

                                          Each exclusion uses exact string comparison and must be separated by a new line. User names are only excluded if they exactly match one of the names in this list.

                                          auto_build_user
                                          The example above illustrates that if only revisions by "auto_build_user" have been committed to the SCM a build will not occur.
                                      • $class: 'UserIdentity'
                                        • name : String

                                          If given, "GIT_COMMITTER_NAME=[this]" and "GIT_AUTHOR_NAME=[this]" are set for builds. This overrides whatever is in the global settings.

                                        • email : String

                                          If given, "GIT_COMMITTER_EMAIL=[this]" and "GIT_AUTHOR_EMAIL=[this]" are set for builds. This overrides whatever is in the global settings.

                                      • $class: 'WipeWorkspace'
                                        Delete the contents of the workspace before building, ensuring a fully fresh workspace.
                                      • gitTool : String (optional)

                                    • Was this page helpful?

                                      Please submit your feedback about this page through this quick form.

                                      Alternatively, if you don't wish to complete the quick form, you can simply indicate if you found this page helpful?

                                          


                                      See existing feedback here.