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.

Git Push Plugin

gitPush: Git Push

  • gitScm (optional)
      Nested Object

      The git plugin provides fundamental git operations for Jenkins projects. It can poll, fetch, checkout, and merge contents of git repositories.

      The git plugin provides an SCM implementation to be used with the Pipeline SCM checkout step. The Pipeline Syntax Snippet Generator guides the user to select git plugin checkout options and provides online help for each of the options.

    • userRemoteConfigs
      Specify the repository to track. This can be a URL or a local file path. Note that for super-projects (repositories with submodules), only a local file path or a complete URL is valid. The following are examples of valid git URLs.
      • ssh://git@github.com/github/git.git
      • git@github.com:github/git.git (short notation for ssh protocol)
      • ssh://user@other.host.com/~/repos/R.git (to access the repos/R.git repository in the user's home directory)
      • https://github.com/github/git.git

      If the repository is a super-project, the location from which to clone submodules is dependent on whether the repository is bare or non-bare (i.e. has a working directory).
      • If the super-project is bare, the location of the submodules will be taken from .gitmodules.
      • If the super-project is not bare, it is assumed that the repository has each of its submodules cloned and checked out appropriately. Thus, the submodules will be taken directly from a path like ${SUPER_PROJECT_URL}/${SUBMODULE}, rather than relying on information from .gitmodules.
      For a local URL/path to a super-project, git rev-parse --is-bare-repository is used to detect whether the super-project is bare or not.
      For a remote URL to a super-project, the ending of the URL determines whether a bare or non-bare repository is assumed:
      • If the remote URL ends with /.git, a non-bare repository is assumed.
      • If the remote URL does NOT end with /.git, a bare repository is assumed.
        Array / List of Nested Object
      • url
        Specify the URL or path of the git repository. This uses the same syntax as your git clone command.
        • Type: String
      • name
        ID of the repository, such as origin, to uniquely identify this repository among other remote repositories. This is the same "name" that you use in your git remote command. If left empty, Jenkins will generate unique names for you.

        You normally want to specify this when you have multiple remote repositories.

        • Type: String
      • refspec
        A refspec controls the remote refs to be retrieved and how they map to local refs. If left blank, it will default to the normal behaviour of git fetch, which retrieves all the branch heads as remotes/REPOSITORYNAME/BRANCHNAME. This default behaviour is OK for most cases.

        In other words, the default refspec is "+refs/heads/*:refs/remotes/REPOSITORYNAME/*" where REPOSITORYNAME is the value you specify in the above "name of repository" textbox.

        When do you want to modify this value? A good example is when you want to just retrieve one branch. For example, +refs/heads/master:refs/remotes/origin/master would only retrieve the master branch and nothing else.

        The plugin uses a default refspec for its initial fetch, unless the "Advanced Clone Option" is set to honor refspec. This keeps compatibility with previous behavior, and allows the job definition to decide if the refspec should be honored on initial clone.

        Multiple refspecs can be entered by separating them with a space character. +refs/heads/master:refs/remotes/origin/master +refs/heads/develop:refs/remotes/origin/develop retrieves the master branch and the develop branch and nothing else.

        See the refspec definition in Git user manual for more details.

        • Type: String
      • credentialsId
        Credential used to check out sources.
        • Type: String
    • branches
      List of branches to build. Jenkins jobs are most effective when each job builds only a single branch. When a single job builds multiple branches, the changelog comparisons between branches often show no changes or incorrect changes.
        Array / List of Nested Object
      • name

        Specify the branches if you'd like to track a specific branch in a repository. If left blank, all branches will be examined for changes and built.

        The safest way is to use the refs/heads/<branchName> syntax. This way the expected branch is unambiguous.

        If your branch name has a / in it make sure to use the full reference above. When not presented with a full path the plugin will only use the part of the string right of the last slash. Meaning foo/bar will actually match bar.

        If you use a wildcard branch specifier, with a slash (e.g. release/), you'll need to specify the origin repository in the branch names to make sure changes are picked up. So e.g. origin/release/

        Possible options:

        • <branchName>
          Tracks/checks out the specified branch. If ambiguous the first result is taken, which is not necessarily the expected one. Better use refs/heads/<branchName>.
          E.g. master, feature1, ...
        • refs/heads/<branchName>
          Tracks/checks out the specified branch.
          E.g. refs/heads/master, refs/heads/feature1/master, ...
        • <remoteRepoName>/<branchName>
          Tracks/checks out the specified branch. If ambiguous the first result is taken, which is not necessarily the expected one.
          Better use refs/heads/<branchName>.
          E.g. origin/master
        • remotes/<remoteRepoName>/<branchName>
          Tracks/checks out the specified branch.
          E.g. remotes/origin/master
        • refs/remotes/<remoteRepoName>/<branchName>
          Tracks/checks out the specified branch.
          E.g. refs/remotes/origin/master
        • <tagName>
          This does not work since the tag will not be recognized as tag.
          Use refs/tags/<tagName> instead.
          E.g. git-2.3.0
        • refs/tags/<tagName>
          Tracks/checks out the specified tag.
          E.g. refs/tags/git-2.3.0
        • <commitId>
          Checks out the specified commit.
          E.g. 5062ac843f2b947733e6a3b105977056821bd352, 5062ac84, ...
        • ${ENV_VARIABLE}
          It is also possible to use environment variables. In this case the variables are evaluated and the result is used as described above.
          E.g. ${TREEISH}, refs/tags/${TAGNAME}, ...
        • <Wildcards>
          The syntax is of the form: REPOSITORYNAME/BRANCH. In addition, BRANCH is recognized as a shorthand of */BRANCH, '*' is recognized as a wildcard, and '**' is recognized as wildcard that includes the separator '/'. Therefore, origin/branches* would match origin/branches-foo but not origin/branches/foo, while origin/branches** would match both origin/branches-foo and origin/branches/foo.
        • :<regular expression>
          The syntax is of the form: :regexp. Regular expression syntax in branches to build will only build those branches whose names match the regular expression.
          Examples:
          • :^(?!(origin/prefix)).*
            • matches: origin or origin/master or origin/feature
            • does not match: origin/prefix or origin/prefix_123 or origin/prefix-abc
          • :origin/release-\d{8}
            • matches: origin/release-20150101
            • does not match: origin/release-2015010 or origin/release-201501011 or origin/release-20150101-something
          • :^(?!origin/master$|origin/develop$).*
            • matches: origin/branch1 or origin/branch-2 or origin/master123 or origin/develop-123
            • does not match: origin/master or origin/develop

        • Type: String
    • browser
      Defines the repository browser that displays changes detected by the git plugin.
        Nested Choice of Objects
      • $class: 'AssemblaWeb'
        • repoUrl
          Specify the root URL serving this repository (such as https://www.assembla.com/code/PROJECT/git/).
          • Type: String
      • $class: 'BacklogGitRepositoryBrowser'
        • repoName
          • Type: String
        • repoUrl
          • Type: String
      • bitbucketServer
        • repoUrl
          Specify the Bitbucket Server root URL for this repository (such as https://bitbucket:7990/OWNER/REPO/).
          • Type: String
      • $class: 'BitbucketWeb'
        • repoUrl
          Specify the root URL serving this repository (such as https://bitbucket.org/OWNER/REPO/).
          • Type: String
      • $class: 'CGit'
        • repoUrl
          Specify the root URL serving this repository (such as http://cgit.example.com:port/group/REPO/).
          • Type: String
      • $class: 'FisheyeGitRepositoryBrowser'
        • repoUrl
          Specify the URL of this repository in FishEye (such as http://fisheye6.cenqua.com/browse/ant/).
          • Type: String
      • $class: 'GitBlitRepositoryBrowser'
        • repoUrl
          Specify the root URL serving this repository.
          • Type: String
        • projectName
          Specify the name of the project in GitBlit.
          • Type: String
      • $class: 'GitBucketBrowser'
        • url
          • Type: String
      • $class: 'GitLab'
        • repoUrl
          Specify the root URL serving this repository (such as http://gitlabserver:port/group/REPO/).
          • Type: String
        • version (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.
          • Type: String
      • $class: '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
          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
          • Type: String
      • $class: 'GitList'
        • repoUrl
          Specify the root URL serving this repository (such as http://gitlistserver:port/REPO/).
          • Type: String
      • $class: 'GitWeb'
        • repoUrl
          Specify the root URL serving this repository (such as https://github.com/jenkinsci/jenkins.git).
          • Type: String
      • $class: 'GiteaBrowser'
        • repoUrl
          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
          • Type: String
      • $class: 'GithubWeb'
        • repoUrl
          Specify the HTTP URL for this repository's GitHub page (such as https://github.com/jquery/jquery).
          • Type: String
      • $class: 'Gitiles'
        • repoUrl
          Specify the root URL serving this repository (such as https://gwt.googlesource.com/gwt/).
          • Type: String
      • $class: 'GitoriousWeb'
        • repoUrl
          Specify the root URL serving this repository (such as https://gitorious.org/gitorious/mainline).
          • Type: String
      • $class: 'GogsGit'
        • repoUrl
          Specify the root URL serving this repository (such as http://gogs.example.com:port/username/some-repo-url.git).
          • Type: String
      • $class: 'KilnGit'
        • repoUrl
          Specify the root URL serving this repository (such as https://khanacademy.kilnhg.com/Code/Website/Group/webapp).
          • Type: String
      • $class: 'Phabricator'
        • repoUrl
          Specify the phabricator instance root URL (such as http://phabricator.example.com).
          • Type: String
        • repo
          Specify the repository name in phabricator (such as the foo part of phabricator.example.com/diffusion/foo/browse).
          • Type: String
      • $class: 'RedmineWeb'
        • repoUrl
          Specify the root URL serving this repository (such as http://SERVER/PATH/projects/PROJECT/repository).
          • Type: String
      • $class: 'RhodeCode'
        • repoUrl
          Specify the HTTP URL for this repository's RhodeCode page (such as http://rhodecode.mydomain.com:5000/projects/PROJECT/repos/REPO/).
          • Type: String
      • $class: 'ScmManagerGitRepositoryBrowser'
        • repoUrl
          Specify the root URL serving this repository (such as https://scm-manager.org/scm/repo/namespace/name).
          • Type: String
      • $class: 'Stash'
        • repoUrl
          Specify the HTTP URL for this repository's Stash page (such as http://stash.mydomain.com:7990/projects/PROJECT/repos/REPO/).
          • Type: String
      • $class: 'TFS2013GitRepositoryBrowser'
        • repoUrl
          Either the name of the remote whose URL should be used, or the URL of this module in TFS (such as http://fisheye6.cenqua.com/tfs/PROJECT/_git/REPO/). If empty (default), the URL of the "origin" repository is used.

          If TFS is also used as the repository server, this can usually be left blank.

          • Type: String
      • $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
            The URL is the web URL of the Tuleap Git repository.
            • Type: String
        • $class: 'ViewGitWeb'
          • repoUrl
            Specify the root URL serving this repository (such as http://code.fealdia.org/viewgit/).
            • Type: String
          • projectName
            Specify the name of the project in ViewGit (e.g. scripts, scuttle etc. from http://code.fealdia.org/viewgit/).
            • Type: String
      • gitTool

        Absolute path to the git executable.

        This is different from other Jenkins tool definitions. Rather than providing the directory that contains the executable, you must provide the complete path to the executable. Setting '/usr/bin/git' would be correct, while setting '/usr/bin/' is not correct.

        • Type: String
      • extensions

        Extensions add new behavior or modify existing plugin behavior for different uses. Extensions help users more precisely tune plugin behavior to meet their needs.

        Extensions include:

        • Clone extensions modify the git operations that retrieve remote changes into the agent workspace. The extensions can adjust the amount of history retrieved, how long the retrieval is allowed to run, and other retrieval details.
        • Checkout extensions modify the git operations that place files in the workspace from the git repository on the agent. The extensions can adjust the maximum duration of the checkout operation, the use and behavior of git submodules, the location of the workspace on the disc, and more.
        • Changelog extensions adapt the source code difference calculations for different cases.
        • Tagging extensions allow the plugin to apply tags in the current workspace.
        • Build initiation extensions control the conditions that start a build. They can ignore notifications of a change or force a deeper evaluation of the commits when polling.
        • Merge extensions can optionally merge changes from other branches into the current branch of the agent workspace. They control the source branch for the merge and the options applied to the merge.

          Array / List of Nested Choice of Objects
        • $class: '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
                    • Type: int
                  • ancestorCommitSha1
                    • Type: String
                • $class: 'DefaultBuildChooser'
                  • $class: 'DeflakeGitBuildChooser'
                    • $class: 'GerritTriggerBuildChooser'
                      • $class: 'InverseBuildChooser'
                    • $class: '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.
                      • $class: 'ChangelogToBranch'
                        This method calculates the changelog against the specified branch.
                        • options
                            Nested Object
                          • compareRemote
                            Name of the repository, such as origin, that contains the branch you specify below.
                            • Type: String
                          • compareTarget
                            The name of the branch within the named repository to compare against.
                            • Type: String
                      • $class: 'CheckoutOption'
                        • timeout
                          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).
                          • Type: int
                      • $class: '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 (optional)
                          Deletes untracked submodules and any other subdirectories which contain .git directories.
                          • Type: boolean
                      • $class: 'CleanCheckout'
                        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 (optional)
                          Deletes untracked submodules and any other subdirectories which contain .git directories.
                          • Type: boolean
                      • $class: 'CloneOption'
                        • shallow
                          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.
                          • Type: boolean
                        • noTags
                          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.
                          • Type: boolean
                        • reference
                          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.
                          • Type: String
                        • timeout
                          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).
                          • Type: int
                        • depth (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.
                          • Type: int
                        • honorRefspec (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.
                          • Type: boolean
                      • $class: 'CodeCommitURLHelper'
                        • credentialId

                          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.

                          • Type: String
                        • repositoryName
                          • Type: 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'
                            • $class: 'GitLFSPull'
                              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 (optional)
                                  If this option is checked, verbose log will be output to build console; the verbose log is useful for debugging the publisher creation.
                                  • Type: boolean
                              • $class: 'GitSCMStatusChecksExtension'
                                • name (optional)
                                  • Type: String
                                • skip (optional)
                                  • Type: boolean
                                • skipProgressUpdates (optional)
                                  • Type: boolean
                                • suppressLogs (optional)
                                  • Type: boolean
                                • unstableBuildNeutral (optional)
                                  • Type: boolean
                              • $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 (optional)
                                  • Type: boolean
                              • $class: 'IgnoreNotifyCommit'
                                If checked, this repository will be ignored when the notifyCommit-URL is accessed regardless of if the repository matches or not.
                                • $class: '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
                                    • Type: String
                                • $class: 'MessageExclusion'
                                  • excludedMessage
                                    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.
                                    • Type: String
                                • $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
                                    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.
                                    • Type: String
                                  • excludedRegions
                                    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.
                                    • Type: String
                                • $class: '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
                                        The name of the branch within the named repository to merge to, such as master.
                                        • Type: String
                                      • 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 (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.
                                        • Type: String
                                      • 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 (optional)
                                          • Type: boolean
                                      • squash

                                        Squashed Commit Strategy

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

                                        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>
                                        • Type: String
                                      • repoName

                                        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

                                        • Type: String
                                    • $class: 'PruneStaleBranch'
                                      Run "git remote prune" for each remote, to prune obsolete local branches.
                                      • pruneTags
                                        • pruneTags
                                          • Type: boolean
                                      • $class: 'RelativeTargetDirectory'
                                        • relativeTargetDir
                                          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.

                                          • Type: String
                                      • $class: 'ScmName'

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

                                        • name
                                          • Type: String
                                      • $class: 'SparseCheckoutPaths'

                                        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
                                            • Type: String
                                      • $class: 'SubmoduleOption'
                                        • disableSubmodules
                                          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.
                                          • Type: boolean
                                        • recursiveSubmodules
                                          Retrieve all submodules recursively (uses '--recursive' option which requires git>=1.6.5)
                                          • Type: boolean
                                        • trackingSubmodules
                                          Retrieve the tip of the configured branch in .gitmodules (Uses '--remote' option which requires git>=1.8.2)
                                          • Type: boolean
                                        • reference
                                          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
                                            
                                          • Type: String
                                        • timeout
                                          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).
                                          • Type: int
                                        • parentCredentials
                                          Use credentials from the default remote of the parent project.
                                          • Type: boolean
                                        • depth (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.
                                          • Type: int
                                        • shallow (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.
                                          • Type: boolean
                                        • threads (optional)
                                          Specify the number of threads that will be used to update submodules.
                                          If unspecified, the command line git default thread count is used.
                                          • Type: int
                                      • $class: 'UserExclusion'
                                        • excludedUsers
                                          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.
                                          • Type: String
                                      • $class: 'UserIdentity'
                                        • name

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

                                          • Type: String
                                        • email

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

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

                                        Removed facility that was intended to test combinations of git submodule versions. Removed in git plugin 4.6.0. Ignores the user provided value and always uses false as its value.

                                        • Type: boolean
                                      • submoduleCfg (optional)

                                        Removed facility that was intended to test combinations of git submodule versions. Removed in git plugin 4.6.0. Ignores the user provided value(s) and always uses empty values.

                                          Array / List of Nested Object
                                        • submoduleName

                                          Removed in git plugin 4.6.0.

                                          • Type: String
                                        • branches

                                          Removed in git plugin 4.6.0.

                                          • Type: Array / List of String
                                    • targetBranch (optional)
                                      • Type: String
                                    • targetRepo (optional)
                                      • Type: String

                                    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.