Gitblit Documentation
repository·master·Indexed 25 days ago
https://github.com/gitblit-org/gitblitA 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.
What's inside Gitblit
- 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.
Java Runtime Requirements
masterTo run Gitblit, you must have one of the following installed:
- Java 8 Runtime Environment (JRE)
- Java 8 Development Kit (JDK)
Build Gitblit from source
masterGitblit uses Git submodules. Ensure you clone the repository recursively or initialize submodules manually before building.
Prerequisites
- Submodules: Clone using
--recursiveor rungit submodule update --init --recursive. - IDE: Eclipse is recommended as project settings are preconfigured.
- Build Tool: Apache Ant.
Build Steps
- Import the gitblit project into your Eclipse workspace.
- Execute the
build.xmlscript in the project root using Ant. This step downloads build dependencies and generates theKeysclass used for accessing settings. - Refresh the project in Eclipse to resolve build errors.
- (Optional) Run the
com.gitblit.tests.GitBlitSuiteJUnit test suite to verify the build. Note that this suite clones repositories from the web. - To start the server, execute the
com.gitblit.GitBlitServerclass.
git submodule update --init --recursive- Submodules: Clone using
Configure the GitBlit YouTrack Receive Hook
masterThe 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.propertiesAdd or update the following entries in your
gitblit.propertiesfile. 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.groovyscript into the<gitblit-data-dir>/groovydirectory.3. Enable for a Repository
- In the GitBlit web interface, navigate to a repository.
- Click the edit button, then click the receive link.
- In the post0receive scripts section, find
youtrackand move it to the Selected column. - Scroll to the custom fields section at the bottom of the page.
- 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
34in projectfizz:git commit -m 'Changed bazinator to fix issue #fizz-34.'Lucene repository index storage structure
masterGitblit uses Lucene for repository indexing. For each repository, the index data and configuration are stored within a specific subdirectory named
lucenelocated inside the repository's root folder.Within this
lucenedirectory, a configuration file namedgb_lucene.confis used to manage index settings.Manage plugins via SSH commands
masterGitblit provides a
plugincommand group accessible via SSH for administrative plugin management. These commands allow you to list, install, start, stop, and manage the lifecycle of plugins directly from the command line.Note: These commands are marked as
admin = trueand require administrative privileges.Configure Ant build environment
masterWhen building Gitblit, you can use the following environment variables and configurations:
- ANSI Colors: If using an ANSI-capable console, set
MX_COLOR=truebefore running Ant to enable colored output. - Maven Proxy: The Ant build script honors Maven proxy settings. For fine-tuning, refer to the Moxie
settings.moxiedocumentation.
set MX_COLOR=true- ANSI Colors: If using an ANSI-capable console, set
Lucene index configuration file location
masterThe Lucene index configuration file for a repository is namedgb_lucene.conf. It is located in thelucenesubdirectory of the repository folder.Show plugin details
masterUse
plugin show <ID|INDEX>to view detailed information about a specific plugin, including its version, dependencies, extensions, and available releases.Arguments:
<ID>| <INDEX>: The plugin ID or its numerical index.
Install a plugin
masterUse
plugin install <URL|ID>to download and install a plugin.Arguments:
<URL>|<ID>: The direct URL to a plugin ZIP file or the plugin ID from the registry.
Options:
--version <VERSION>: The specific version of the plugin to install.--noverify: Disable checksum verification.
Uninstall a plugin
masterUse
plugin uninstall <ID|INDEX>to remove a plugin from the system.Aliases:
rm,delArguments:
<ID>|<INDEX>: The plugin ID or its numerical index.
List available plugins
masterUse
plugin availableto see plugins that can be installed from the registry.Options:
--refresh,-r: Refresh the plugin registry before listing.--updates,-u: Only show plugins that have updates available.--noverify: Disable checksum verification.