Git

This page describes how to use FishEye's native repository access to connect to a Git repository. The process for doing this depends on where the Git repository is hosted – connecting to a Git repo that is hosted in Atlassian Stash is much easier.

FishEye interacts with Git repositories by executing the Git command in a separate process. Hence, the server running FishEye needs to have Git installed. FishEye indexes Git repositories by making a private, bare clone of your repository within FishEye's cache area. It uses this private clone for most Git operations.

Requirements

Git repositories hosted in Stash

When Atlassian Stash is integrated with FishEye:

  • You can easily add Git repositories to FishEye. The repository behaves just like a native repository in FishEye, so your team gets all the benefits of FishEye indexing, browsing and searching. 
  • The repository becomes available to Crucible (when integrated), so you can perform in-depth code reviews for changes in the repository. 
  • When you add a Stash repository to FishEye, a push to the repository will by default automatically trigger FishEye to run an incremental index. No further configuration is required – you don't have to configure polling for new commits, or set up dedicated FishEye web hooks in your Stash instance.

You'll need to have an account in the Stash instance, as well as permission to view the repository that you want to add.

  1. Click the 'cog' menu in the FishEye header, and choose Administration (you'll need to be logged in as an administrator to see this link).
  2. Click Repositories (under 'Repository Settings').
  3. Click the Stash repositories tab, and authenticate with the Stash server if necessary.
  4. If multiple instances of Stash are connected to FishEye, use the Stash server list to choose the instance of Stash that hosts the repository you wish to add.
  5. Optionally, type a filter pattern to restrict the list of displayed repositories to those with a matching name, key or project.
  6. Click Add for each repository that you wish to add to FishEye.

When you add a Stash repository:

  • FishEye creates a read-only SSH key and adds that as an access key to the repository in Stash. If this operation fails, the key will be added as a user key to your profile in Stash. You can check if an access key was added by viewing the repository's settings in Stash. See Using SSH keys to secure Git operations in the Stash documentation for more information.

Git repositories hosted elsewhere

When adding or managing a Git repository, you can do the following:


To add an external Git repository to FishEye:

  1. Click the 'cog' menu in the FishEye header, and choose Administration (you'll need to be logged in as an administrator to see this link).
  2. Click Repositories (under 'Repository Settings').
  3. Click Native repository access, and then Add repository.
  4. Complete the wizard:

Step 1

Field

Description

Repository Type

Select Git.

Name

Enter a name for this repository. The name may contain alphanumeric, underscore, '-' or '.' characters. This will be repository name in FishEye.

Description

Enter a short description of this repository.

Step 2

Field

Description

Repository Location

Enter the URL describing the Git repository location. FishEye will clone this repository for indexing purposes. You can use any URL recognised by Git itself. Fisheye recognizes the following URL's:

git://server_name[:port]/path_to_repository
http://server_name[:port]/path_to_repository
https://server_name[:port]/path_to_repository
ssh://server_name[:port]/path_to_repository
file://[hostname]/path_to_repository

Do not use spaces in your URL.

Path

(optional) Enter the path within the Git repository that you want FishEye to index. This lets you limit FishEye to indexing a subset of the complete Git repository.

Block Size

(optional) Enter how many commits you want FishEye to process in one batch. Larger values require more memory and increase the amount of work FishEye commits to the database in a single operation. The default is 400. The minimum being 1. This field only accepts positive whole numbers. Requires a repository restart.

Command Timeout

(optional) Enter the time that a single Git command is allowed to take to execute. Any command that exceeds this time is terminated and the operation will fail.

Rename Detection

(optional) Select which Git rename detection strategy FishEye will use to detect copy and move operations within the repository. Please refer to the Git documentation for more information.

Step 3

Field

Description

Store Diff Info

Tick this checkbox, if you want FishEye to cache information about file diffs in its database. This is required for some FishEye features. See Configuring Repository Details for more information on this setting.

Enable Repository After Adding

Tick this checkbox, to enable the repository after adding (i.e. when you click the 'Add' button).

Limitations

Indexing of a Git repository can be slow when new branches are pushed. Performance in such cases can be improved by setting a command line option for FishEye. See this KB page for more information.

Was this helpful?

Thanks for your feedback!

15 Archived comments

  1. User avatar

    Anonymous

    Does fisheye also detect 

    git@server_name:path_to_repository.git

    like it is being displayed for repositories at github.com?

    20 May 2013
  2. User avatar

    Xiaodong Li

    now that TFS (2013) supports Git. I am wondering if it is possible to add tfs git repository (https) to fisheye

    for example, I created a project using git on tfs online: https://mytfs.visualstudio.com/DefaultCollection/mygit and git location is:

    https://mytfs.visualstudio.com/DefaultCollection/_git/mygit 

    After I enabled alternate credential in tfs with username/password, then set git executable path ("C:\Program Files (x86)\Git\bin\git.exe"). I am unable to connect to this repository from fisheye Can you give us an example how to do this? thank you!

    28 Nov 2013
    1. User avatar

      Anthony Brown

      I know this was posted a while ago, but I just figured this out today and so thought I would share the answer.

      In visual studio online, you must set up alternate credentials and create a username for it (without an @ sign) 

      You then should be able to connect by specifying https://myuser@mytfs.visualstudio.com/DefaultCollection/mygit as the git location where myuser is the username created in visual studio online

      17 Jun 2015
  3. User avatar

    Peter Hansen

    Isn't there any "start revision" like for SVN repos? We have migrated from cvs (long time ago) to svn to git (stash) but now our license limit is exceeded in the fisheye starter license (because there are now user names in CVS, SVN and Git fashion for the commits). Any idea how to overcome this problem?

    13 Dec 2013
    1. User avatar

      Peter Hansen

      We have used a git .mailmap file to map all old authors to a dummy-user. After reindexing everything worked well (smile).

      17 Mar 2014
  4. User avatar

    prabhakaran rk

    Is there is any report generation Plugin for Fisheye ?

    16 Jan 2014
  5. User avatar

    Valentin Karailiev

    I just spent couple of hours trying to connect to a Bitbucket git repository and found out that having '#' in the password causes authentication failure. Not sure if this is limoted to Bitbucket or git, but keep it in mind.

    26 Apr 2014
  6. User avatar

    Paul Stahlke

    Is it possible to connect our entire Git instance to FishEye, or must I keep adding every individual repository one at a time?

    26 Nov 2014
    1. User avatar

      Daniel Rohan [Atlassian]

      Hi Paul,

      You must add each repo individually as FishEye can't figure this out on its own. We don't suggest that users modify config.xml directly but if you define one repo you can probably copy and paste the XML with minor modification to add the remaining repos. Make sure you stop the application before editing this file.

      26 Nov 2014
    1. User avatar

      Lukasz Pater [Atlassian]

      Hi Paul,

      You can also use the REST api (/rest-service-fecru/admin/repositories) to trigger repository creation, as soon as a new git repository is added to your git hosting server.

      Alternatively if the repositories are on a filesystem that's reachable from the FishEye instance you might consider using the Repository synchronization plugin.

      27 Nov 2014
  7. User avatar

    Jeff Louwerse

    • FishEye prefixes the Stash project key to the name of the newly added repository, to help you identify the origin of the repository.

    It does?  I am not seeing it and I was not given a choice to edit it when I added it.   The repo I just added went in simply as "Tools" and the project key "SPWB" is nowhere to be seen (at least visually).   This will be problematic if more than one of the projects on the stash instance uses a repo called tools which is very likely.  Or should another stash server be set up for another group and they call a repo Tools.. what will happen?

     

    26 Feb 2015
    1. User avatar

      Piotr Swiecicki [Atlassian]

      Thanks Jeff Louwerse.  Indeed the behaviour is slightly different, repository name in FishEye is not actually prefixed with the Stash repository name at the moment.  If you think it should, feel free to vote on and watch  FE-5264 - Stash repository integration custom naming Open  issue.

      26 Feb 2015
      1. User avatar

        Jeff Louwerse

        thanks.  I don't agree that this is an improvement but it is in fact a bug.   Furthermore if your documentation states a behaviour and it doesn't behave that way, that is a bug!

        in 3.7.0 I am not asked to give it a new name if a repository with the same name already exists.  I am simply given an error and until this issue is fixed I can't add the repository to Fisheye...

         

             Problem communicating with Stash

             Repository 'enter_name_here' already exists.

         

        26 Feb 2015
  8. User avatar

    Matthew White

    I am in a test period and have been patiently trying to figure out how to get Fisheye and Crucible to talk to Github. I have been able to configure JIRA successfully but I haven't been able to configure the Fisheye/Crucible add-on. I have been scouring videos, forums, ect. for help to no avail. What I have done is follow these instructions to the letter all to get an error with both SSH and HTTPS. The following are my errors.

    With SSH it reads:

    Could not find SSH binary on the system path. See https://confluence.atlassian.com/display/FISHEYE/Authentication

    Error testing connection.
    Could not find SSH binary on the system path. See https://confluence.atlassian.com/display/FISHEYE/Authentication
    at com.atlassian.guava.base.Preconditions.checkNotNull(Preconditions.java:209)
    at com.atlassian.fecru.security.SshWrapper.<init>(SshWrapper.java:20)
    at com.atlassian.fisheye.dvcs.client.DvcsProcessFactory$DvcsProcessBuilder.initProcessBuilder(DvcsProcessFactory.java:92)
    at com.atlassian.fisheye.git.client.GitProcessFactory$GitProcessBuilder.initProcessBuilder(GitProcessFactory.java:34)
    at com.atlassian.fisheye.dvcs.client.DvcsProcessFactory$DvcsProcessBuilder.build(DvcsProcessFactory.java:76)

    Connection failed.

    With HTTP(S) it reads:

    Error testing connection.
    Error talking to repository:

    at com.atlassian.fisheye.git.GitScmConfig.testConnection(GitScmConfig.java:120)
    at com.cenqua.fisheye.RepositoryConfig.testConnection(RepositoryConfig.java:441)
    at com.atlassian.fisheye.spi.admin.impl.DefaultRepositoryAdminService.testConnectionFor(DefaultRepositoryAdminService.java:862)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)

    Connection failed.

    Yes I have clicked the link within the error and read it to it's entirety to again no avail at resolving this dilemma. I have coped and pasted repo URL directly from the link in GitHub so I know it's not a spelling error. I have modded the URL according to this forum and others. I have copied the SSH key into the Settings -> SSH Keys in GitHub. I have also tried within the repository clicking Settings -> Deploy keys -> Add deploy key. Both of these still resulted in disappointment with the errors listed above. The GitHub App is able to resolve the HTTPS:// login and work fine. I have also checked my local machine firewall and found nothing marked as blocked.

    When running Wireshark and attempting to use both HTTPS and SSH and clicked test connection there is no HTTP(S) or SSH traffic even being generated. I am now confident is stating this is an application layer problem with Fisheye/Crucible.

    Any help would be appreciated. These are the last days of my trial. Not looking very promising.

    17 Apr 2015
    1. User avatar

      Marek Parfianowicz [Atlassian]

      Could not find SSH binary on the system path.

      Please check if you have ssh installed and available on your system path. See https://answers.atlassian.com/questions/316646

      22 Jun 2015
Powered by Confluence and Scroll Viewport