Quickly learn how to connect Tracked Folders via Git Integration for Jira Server app.
What's on this page:
Only commits and branches get indexed with this method.
Less storage is required (the repositories are not cloned to Jira).
Pull/merge requests are not indexed with this method.
The create branch/pull request feature does not work.
The Add tracked folder feature requires that Jira and the git servers be on the same filesystem. Make sure that the user that Jira is running with has access permissions to the path with the git repositories.
Introduced in v2.9.0 of the Git Integration for Jira app, this feature scans a locally accessible path for cloned Git repositories and automatically imports those Git repository references into Jira. A repository group called FOLDER is added into the Git Integration for Jira app repository settings.
Right click here and view this video in a new tab/window.
Connecting to a tracked folder
To add repositories via Tracked Folders:
Go to Manage Git Repositories (Jira Dashboard ➜ Git menu) in Jira Server.
Click the dropdown arrow on Connect to Git Repository then Add tracked folder. The following dialog is displayed.
Enter the Tracked folder location in the required field. For this feature, a local path to the git repository residing on the same server as Jira is required. For example: /home/ec2-user/repositories/*.
Set the Folder Depth according to your organization’s requirements. For more information on this feature, see the Folder Depth section below.
Optional. Expand the Advanced twisty to set the JMESPath options (see more details below) to filter connected repositories to Jira.
In the following dialog, the wizard will find git repositories stored in the provided path and displays the list of repositories found.
In the above example repository root, /home/ec2-user/repositories/*, all repositories under this mask (/home/ec2-user/repositores/TestGitPluginRepo, /home/ec2-user/repositores/emptyRepo, … , /home/ec2-user/repositores/jira-git-plugin) will be handled as one entry in the Git Repositories configuration page. For other features, these are treated as separate repositories.
The Add tracked folder wizard scans the local path one folder level deep or depending on the Folder Depth setting. Click Import repositories. The wizard automatically adds the detected repositories to Jira. If a repository is added to the path, Jira will add it to the index. If a repository is removed from the path, Jira will drop the index for that repository.
On the Settings dialog, set Repository Browser, Smart Commits and Project Association permissions, if required. Click Next.
Click Finish to complete adding the tracked folder.
The tracked folder is added to the repository configuration list.
You can add multiple tracked folders in case your repositories are spread among multiple locations.
Folder depth setting
GitLab 13+ switched to hashed storage as the default. Git Integration for Jira app also supports this move by implementing support to tracked repositories with a new folder depth option for the GitLab hashed storage.
In GitLab 13.0, hashed storage is enabled by default and the legacy storage is deprecated. Support for legacy storage will be removed in GitLab 14.0.
The default tracked folder depth value is 1. For GitLab hashed storage support, our recommended setting is 3.
On the Git Repositories settings page, click Actions ➜ Edit tracked folder to modify tracked folder git repository settings.
Removing a tracked folder
On the Git Repositories settings page, click Actions ➜ Delete tracked folder to remove the tracked folder configuration from Jira.
A confirmation prompt will be displayed. Clicking Remove will only remove the tracked folder setting from the repository configuration list. The local path for this tracked folder will not be deleted and will still remain in the local system for later use.
On the Git Repositories settings page, click Actions ➜ Reset index.
This action will reset the indexes of the repositories for the selected tracked folder.
Viewing tracked repositories
On the Git Repositories settings page, click Actions ➜ Show tracked repositories.
This action will open the Tracked Folder dialog showing the tracked repositories.
The Repository Browser will not display the repository if it is disabled in the Git Repositories configuration. The commits and code diffs in the Issue ➜ Git Commits, Git Roll Up and Project tabs will also be unavailable due to this.
Reindexing a tracked folder
On the Git Repositories settings page, click Actions ➜ Reindex tracked folder.
This action will perform a reindex of the selected tracked folder.
If a new repository is manually added into the local path, the Git Integration for Jira app will detect the new repository folder on the next reindex and add it into the existing tracked folder in Jira.
If a repository folder is manually deleted from the local path, the Git Integration for Jira app will remove the repository setting from the tracked folder in Jira on the next reindex.
Viewing git commits in Jira Server
Perform a git commit by adding the Jira issue key in the commit message. This will associate the commit to the mentioned Jira issue.
Open the Jira issue.
Scroll down to the Activity panel then click the Git Commits tab.
Click View Full Commit to view the code diff.
It is possible to track all repositories hosted on a GitLab server from inside a Jira server:
Setup NFS server on the GitLab computer
Mount GitLab repositories folder as a remote NFS folder on Jira server
Configure NFS permissions to allow Jira to access GitLab folders by using either of the two possible solutions:
The 'all_squash' option must not be used in the NFS server 'etc/exports' file for GitLab folders. The NFS client should have the 'git' group with the same GID as the 'git' group on the NFS server. The Jira user on the NFS client should be added to the group 'git'.
Use the 'all_squash,async,anonuid=$uid,anongid=$gid' option on the NFS server, where $uid and $gid are the user ID and group ID for 'git' user and 'git' group respectively (or another user/group which you are using to access GitLab repositories on GitLab server).