Git Integration for Jira Self-Managed (Data Center/Server) Documentation

Contact Support
GitKraken Status  

Gerrit


 

Integrate Gerrit with Jira Data Center

Quickly learn how to connect Gerrit git repositories via Git Integration for Jira Data Center.
For the Jira Cloud version of this document click Here

What’s on this page:


 

Right click here to open this video in a new browser tab for more viewing options.

 

Using Full feature Integration

  1. On your Jira dashboard, go to menu Git ➜ Manage repositories.

  2. Click Gerrit on the Auto-connect integration panel. The Auto-connect wizard appears.


    • Enter your git server’s Host URL.

    • Enter login credentials for username and password.

    • OPTIONAL Click Advanced to setup how git fetches refs.


      • Setup fetch refspec by selecting options needed for this integration. A refspec maps a branch in the local repository to a branch in a remote repository. For more information, see Git Refspec.

      • For Clone and index other refs, enable it to define a custom refspec tailored for this integration. A refspec is specified as [+]<source>:<destination> — where, <source> is the source branch in the local repository and <destination> is the destination branch in the remote repository. The optional + sign instructs git to force the remote repository to perform a non-fast-forward update.

      • For more detailed information on formatting, see Git Fetch.

        Note:
        The new values will be applied to the subsequent fetches only instead of applying it to the objects that have been already fetched.
  3. Click Connect. The Auto-connect wizard automatically reads git repositories for import into the git configuration.

  4. Click Import repositories. The Settings screen is displayed.


    • Set Smart Commits, Repository Browser options or leave it as is.

    • Set Project Permissions by restricting it to specific projects or leave it as is (associate with all projects).

  5. Click Finish to complete this setup.

 

Single Repository (Manually Connect via SSH, HTTP, HTTPS)

Login to your Gerrit account. Obtain the repository URL from the Gerrit repository project page.  Use SSH or HTTP/HTTPS.

  1. On your Jira dashboard menu, go to Git ➜ Manage repositories.

  2. Click Connect to Git Repository to open the Connect Wizard.

  3. Paste the URL from Gerrit web portal in the provided box. (Example: http(s)://<your.org.com>/<repo_name>)

  4. Click Next. The Settings page is displayed.


    • Set Smart Commits, Repository Browser options or leave it as is.

    • Set Project Permissions by restricting it to specific projects or leave it as is (associate with all projects).

  5. Click Finish to complete this process.

The refspec options are not available for single repository connections of Gerrit integration.

The repository is now connected to Jira Data Center.

 

Setting Up Gerrit Web Links

Web links are automatically configured for Gerrit repositories with Auto-connect integration.

For manual integration. setting up web links for Gerrit integration is optional.

Configure web links from either of the following locations:

  • Advanced setup in Connect Wizard

  • Git ➜ Manage repositories ➜ Edit repository/integration settings.

Select the Gerrit git host from the Web Link dropdown list.

Set the variables to the actual URL settings of the git host.

Save the changes.

 

Viewing Git Commits in Jira Data Center

  1. Perform a git commit by adding the Jira issue key in the commit message. This will associate the commit to the mentioned Jira issue.

  2. Open the Jira issue.

  3. Scroll down to the Activity panel then click the Git Commits tab.

  4. Click View Full Commit to view the code diff.

 

Default Branch

Most git integrations allow changing of the default branch of the repository/project other than “master”. This change is reflected in the Repository Settings of the Git Integration for Jira app on the next reindex. Auto-connected integrations support this feature where Git Integration for Jira app gets the default branch from almost all integrations and apply this setting at repository level.

For the case with Gerrit, the default main branch is always “master”.

Main branch for repositories within an integration can only be changed on the git server.

How to enable GetRepositories log response from Gerrit to the Jira log?

  1. Open Jira System Administration then click Logging and profiling on the left sidebar.

  2. Under the Default loggers section, click Configure….

  3. Set the Package name to com.bigbrassband.jira.git.services.integration.

  4. Set Logging Level to DEBUG.

  5. Click Add to proceed.

IMPORTANT! Remember to turn this setting off after you have obtained the log file for analysis.

 


More Integration Guides

GitHub.com (Git Integration for Jira Data Center/Server)

GitHub Enterprise Server (Git Integration for Jira Data Center/Server)

GitHub App integration (Git Integration for Jira Data Center/Server)

GitLab.com (Git Integration for Jira Data Center/Server)

GitLab CE/EE (Git Integration for Jira Data Center/Server)

Azure DevOps | Visual Studio Team Services (VSTS) (Git Integration for Data Center/Jira Server)

Azure DevOps Server | Team Foundation Services (TFS) (Git Integration for Jira Data Center/Server)

AWS CodeCommit (Git Integration for Jira Data Center/Server)

Gerrit (this page)

Bitbucket Server (Git Integration for Jira Data Center/Server)

Bonobo (Git Integration for Jira Data Center/Server)

Windows Network | Server Share

Tracked Folders (Git Integration for Jira Data Center/Server)

Back to: Integration basics (Git Integration for Jira Data Center/Server)

Have feedback about this article? Did we miss something? Let us know!
On this page