Gitblit Documentation

repository·master·Indexed 25 days ago

https://github.com/gitblit-org/gitblit

A pure Java-based Git server providing repository management, viewing, and serving capabilities over GIT, HTTP, and SSH transports. Features include a web interface for management, authentication against multiple providers, Lucene-based repository indexing, and administrative plugin management via SSH commands.

Tokens
1.6K
Snippets
2
Records
17
Agent score
81%

What's inside Gitblit

  1. Overview of Gitblit

    master
    Gitblit is an open source, pure Java Git solution designed for managing, viewing, and serving Git repositories. It supports multiple transport protocols including GIT, HTTP, and SSH. It features authentication against multiple providers and provides a web interface for repository management.
  2. Build Gitblit from source

    master

    Gitblit uses Git submodules. Ensure you clone the repository recursively or initialize submodules manually before building.

    Prerequisites

    • Submodules: Clone using --recursive or run git submodule update --init --recursive.
    • IDE: Eclipse is recommended as project settings are preconfigured.
    • Build Tool: Apache Ant.

    Build Steps

    1. Import the gitblit project into your Eclipse workspace.
    2. Execute the build.xml script in the project root using Ant. This step downloads build dependencies and generates the Keys class used for accessing settings.
    3. Refresh the project in Eclipse to resolve build errors.
    4. (Optional) Run the com.gitblit.tests.GitBlitSuite JUnit test suite to verify the build. Note that this suite clones repositories from the web.
    5. To start the server, execute the com.gitblit.GitBlitServer class.
    git submodule update --init --recursive
  3. Configure the GitBlit YouTrack Receive Hook

    master

    The YouTrack Receive Hook allows GitBlit to automatically update referenced YouTrack issues when code is pushed. This requires configuring credentials in gitblit.properties, placing the script in the correct directory, and enabling it for specific repositories.

    1. Update gitblit.properties

    Add or update the following entries in your gitblit.properties file. Note that YouTrack currently requires a username and password for authentication via the REST API.

    • groovy.customFields = "youtrackProjectID=YouTrack Project ID" (Append to existing settings if necessary)
    • youtrack.host = <your-youtrack-host>
    • youtrack.user = <your-username>
    • youtrack.pass = <your-password>

    2. Install the Script

    Copy the youtrack.groovy script into the <gitblit-data-dir>/groovy directory.

    3. Enable for a Repository

    1. In the GitBlit web interface, navigate to a repository.
    2. Click the edit button, then click the receive link.
    3. In the post0receive scripts section, find youtrack and move it to the Selected column.
    4. Scroll to the custom fields section at the bottom of the page.
    5. Enter the corresponding YouTrack Project ID in the YouTrack Project ID field.

    4. Reference Issues in Commits

    To trigger an update, reference issues in your commit messages using the format #{projectID}-{issueID}. You can reference multiple issues in a single commit.

    Example: To reference issue 34 in project fizz:

    git commit -m 'Changed bazinator to fix issue #fizz-34.'
  4. Configure Ant build environment

    master

    When building Gitblit, you can use the following environment variables and configurations:

    • ANSI Colors: If using an ANSI-capable console, set MX_COLOR=true before running Ant to enable colored output.
    • Maven Proxy: The Ant build script honors Maven proxy settings. For fine-tuning, refer to the Moxie settings.moxie documentation.
    set MX_COLOR=true