logo flat Git Integration for JIRA. See Git commits in JIRA.

Welcome Git Admin!

You are probably reading this page because a JIRA administrator has requested access to the Git server.  The JIRA administrator has installed the Git Integration for JIRA add-on.


What is the Git Integration for JIRA add-on?

The Git Integration for JIRA add-on pulls data from a Git source code control repository.  JIRA users will be able to see code in Git in context with JIRA projects and issues.  Even non-technical users will be able to see Git in the familiar JIRA interface.

JIRA users will be able to securely browse content in Git without requiring you to create IDs for every user.


How does JIRA interact with the Git server?

The Git Integration for JIRA add-on acts as a regular Git client.  It performs a scheduled pull from the repository.


What does the JIRA administrator need?

The JIRA administrator needs the ability to clone the repository and pull from it just like a regular developer workstation would do.

We recommend that you create a new user identity specifically for this JIRA server.

For Git repositories with HTTP/HTTPS access

Please do the following:

  1. Create a new user for the JIRA server.
  2. Send the JIRA administrator:
  • The URL to the Git server
  • For example:  https://gitserver/repo/timetrackingproject.git
  • The username and password for the user you created

For Git repositories with SSH access

Please do the following:

  1. Define a new SSH public/private key pair for the JIRA server
  2. Install the public key on the Git server
  3. Send the JIRA administrator:
  • The URL to the Git server
  • For example:  git@gitserver:repo/timetrackingproject.git
  • The private key you created

For Git repositories with Git protocol access

Send the JIRA administrator the URL to the Git server.

For example:  git://gitserver/repo/timetrackingproject.git

For Git repositories on the same host as JIRA

Send the JIRA administrator the full path to the Git repository.

For example:  /home/git/repo/timetrackingproject.git

For Git repositories across network file shares

If you have users access the Git repository over a network file share using Windows file sharing or NFS, the network share will need to be mounted on the JIRA server.  Assist the JIRA administrator in mounting the network share.  Then, provide the JIRA administrator with the path to the Git repository over the network share.

Linux example: /mnt/gitserver/home/git/repo/timetracking.git

Windows example: \\gitserver\git\repo\timetracking.git

For Git repositories hosted on Windows servers

For cases when git repositories are hosted at Windows servers (Windows Server network drive) – while it is using the Windows server networking, the network credentials accessing the git repository must be the same as the user running JIRA.

The repository setting for Enable Fetches of the configured network path must be Git Repository hosted on same server as JIRA.

For JIRA hosted on Windows

When using Active Directory accounts for repository access, changing the password of the AD account running JIRA can cause repository authentication issues.

Restart JIRA to regain access to repositories.


Adding a Repository Hosted on Windows Servers or Windows Network Share

Add a new network share or Windows server hosted repository via the Connect to Git Repository wizard.

The wizard will continue without errors if the following conditions are met:

  • The network credentials accessing the git repository must be the same as the user running JIRA.
  • The network path is not longer than 255 characters.
  • The user under which JIRA is running should have read access to network path.

In the Git configuration page, edit the repository via Actions > Edit repository.

Under Repository Settings, set Enable Fetches option to Git repository hosted on the same server as JIRA.

Considering the above conditions, verify if the repository can be cloned successfully using the network path.  With the server which hosts JIRA, start the command-line session under the same user which JIRA is running on.

For example:

$ git clone file:////Ws148/Photo/repo
Cloning into ‘network-repo’...

If the path is invalid, does not exist or has permission issues, an error similar to the following will be displayed:

fatal: '//Ws148/Photo/repo' does not appear to be a git repository
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.

For more information, see Documentation: Adding a Repository Hosted on Windows Servers or Windows Network Share open in new tab .


Setting Up Repository Root Not Located in JIRA Home Directory

There are three possible ways to setup a repository root that is not located in the JIRA home directory:

  • Clone the repository outside of JIRA then connect to it via Connect to Git Repository  >  Advanced Setup.
  • Clone the repository with the standard Connect to Git Repository Wizard into the JIRA home directory.  Soon afterwards, move the cloned repository and update the settings on the repository.
  • You could symlink the {$JIRA_HOME}/data/git-plugin directory to a different volume.  The standard Connect to Git Repository Wizard will still write there, but the data will reside on the different volume.  But be aware, that Git add-on treats anything in the Git-Plugin folder as a clone that it owns.

Does the Git Integration for JIRA add-on have API commands that allow addition/removal of a Git project?

Yes.  As of v2.8.3 of the Git add-on, the REST API for add, update, and delete repository is implemented.  The documentation for this feature is available at Git Integration for JIRA: Hook and API Reference - Repository REST API open in new tab.


Reindex API to Trigger Indexing

Call the Reindex REST API to have more control on indexing.

Reindex POST API
Use this method to start the reindex process in a separate thread.
Example:  http://jira.yourorg.com/rest/gitplugin/1.0/index.json
Reindex GET API
Use this method to track messages for a particular thread.
Example:
http://jira.yourorg.com/rest/gitplugin/1.0/index.json?threadId=eafe58fc-d8de-42ff-8815-6fe5860b38d2

For more information, see Git Integration for JIRA: Reindex REST API open in new tab .


Reindex Interval

Configuration of the scheduler jobs are no longer accessible in the JIRA administration page.  For this case, the Git add-on offers JIRA administrators this capability via the General screen.

General Configuration Repository Reindex Interval

Set the automatic reindex interval frequency value in minutes as required.  Default value is 5 minutes.  Min = 1, Max = 2147483647.


Web Linking

The web linking feature adds links to your git hosting provider directly into the Git Commits tab.

helpful tip
Configure web linking options while adding/editing repository settings so that commits can include links to the git host pages.

 

Configure Web Linking for GitHub/GitLab

 

For more information, see Documentation: Web Linking open in new tab .


Webhooks

Trigger immediate reindex of your repositories from remote systems via webhooks.

Go to  cog Administration  > Add-ons  >  Git Integration Plugin for JIRA  >  Web Hooks.

helpful tip
If using JIRA 7, go to Administration  > Add-ons. Select Applications on the page tab. Under Git Integration Plugin for JIRA on the sidebar, select General.

Enable/disable the webhook feature by clicking on the Enable webhook checkbox.

The Secret Key is a secure random-generated alphanumeric string at the time of the Git add-on installation.  The user can change this to a different value by generating another secret token according to your Git host.

Use this key in the form of <JIRA_BASE_URL>/git/webhook/reindex/<SECRET_KEY>

Example: https://your.jira.com/rest/gitplugin/webhook/1.0/reindex/sdf34tGdfgGDG345g3y0045TYG23te37

All the repositories will be reindexed if the URL specified above is activated through  GET ,  POST , or  PUT  and the webhooks are enabled.  There will be no authentication checking and support for other HTTP methods such as  DELETE  or  HEAD .  Hence, the body of a  POST  or  PUT  is ignored.

fyi
The Git Integration for JIRA add-on supports GitHub and GitLab push events to define individual repository to index.

 

Adding Webhook for GitHub Repository

 

Adding Webhook for GitLab Repository

 

For more information, see Documentation: Webhooks open in new tab .


Improving Git Tags Performance

Git tags and branches are cached for the most recently viewed 1000 JIRA issues (across all JIRA projects).  The cache is reset each time a new change in any repository is detected.  The cache is built the first time an issue with a tag and/or branch is loaded by a user.  Subsequent loading of JIRA issues with tag or branch information will utilize cached values.


Improving Diff Load Performance

There's a default limit to the size of files that the diff'er supports which is 16MB.  This is to keep a massive file from impacting the JIRA server performance too much.

As of v2.8.5 of the Git add-on, JIRA administrators can control over the size of diffs allowed to be displayed in the code diff dialog:

  1. Go the Administration > Applications.
  2. Under Git Integration for JIRA on the sidebar, select General.
  3. Scroll down to Diff then set the Max Diff Line Count value as desired.  Maximum supported value is 20000.
  4. General Settings Diff Limit
 

Do note that setting this value higher than the default value will impact the performance when loading the code diff of the selected file in the Git Commits tab.  The code diff dialog will truncate the view for each 1500 lines code.  To see the rest of the code, manually expand the view.

Get new product notifications and feature updates from BigBrassBand LLC.
Need to know more?  Read further at  Git Integration for JIRA: Documentation