### Basic Gitblit GO Server Startup Source: https://context7.com/gitblit-org/gitblit/llms.txt Starts the Gitblit GO server using its embedded Jetty instance. Requires the gitblit.jar file in the current directory. ```bash java -jar gitblit.jar ``` -------------------------------- ### Gitblit GO Server Startup with Custom Settings Source: https://context7.com/gitblit-org/gitblit/llms.txt Starts the Gitblit GO server with custom HTTP/HTTPS ports and a specified base folder for configuration and data. ```bash java -jar gitblit.jar \ --baseFolder /var/gitblit \ --httpPort 8080 \ --httpsPort 8443 ``` -------------------------------- ### Gitblit Server Command Line Parameters Source: https://context7.com/gitblit-org/gitblit/llms.txt List of common command-line parameters for starting and configuring the Gitblit GO server. ```bash # Command line parameters: # --httpPort HTTP port (0 to disable) # --httpsPort HTTPS port (0 to disable) # --shutdownPort Port for shutdown command # --baseFolder Base folder for configuration and data # --dailyLogFile Enable daily rolling log file # --repositoriesFolder Override repository location ``` -------------------------------- ### Federation URL Example Source: https://context7.com/gitblit-org/gitblit/llms.txt Example of a curl command to pull repository data from a federated Gitblit server. Replace TOKEN with your actual federation token. ```bash curl "https://source-server/federation/?req=PULL_REPOSITORIES&token=TOKEN" ``` -------------------------------- ### Java Federation Client Usage Source: https://context7.com/gitblit-org/gitblit/llms.txt Example of how to use the Gitblit Federation Client from the command line. Specify the server URL, token, and the local folder to store repositories. ```bash java -cp gitblit.jar com.gitblit.FederationClient \ --url https://source-server \ --token TOKEN \ --repositoriesFolder /path/to/repos ``` -------------------------------- ### Create Repository via RPC Source: https://context7.com/gitblit-org/gitblit/llms.txt Create a new repository using the RPC API. This requires administrative privileges and the `web.enableRpcManagement` configuration to be true. A Java client example is also provided. ```bash # Create a new repository curl -u admin:admin -X POST \ -H "Content-Type: application/json" \ -d '{ "name": "newproject.git", "description": "New Project Repository", "owner": "admin", "accessRestriction": "PUSH", "authorizationControl": "NAMED" }' \ "https://localhost:8443/rpc/?req=CREATE_REPOSITORY" ``` ```java # Using Java RpcUtils client: # RepositoryModel model = new RepositoryModel(); # model.name = "newproject.git"; # model.description = "New Project Repository"; # model.accessRestriction = AccessRestrictionType.PUSH; # RpcUtils.createRepository(model, serverUrl, account, password); ``` -------------------------------- ### Manage Users via RPC Source: https://context7.com/gitblit-org/gitblit/llms.txt Manage user accounts through the RPC interface. This includes listing, getting, creating, and deleting users. Ensure you have the necessary administrative privileges. ```bash # List all users (requires admin) curl -u admin:admin "https://localhost:8443/rpc/?req=LIST_USERS" ``` ```bash # Get specific user information curl -u admin:admin "https://localhost:8443/rpc/?req=GET_USER&name=johndoe" ``` ```bash # Create a new user curl -u admin:admin -X POST \ -H "Content-Type: application/json" \ -d '{ "username": "johndoe", "password": "secretpass", "displayName": "John Doe", "emailAddress": "john@example.com", "canAdmin": false, "canFork": true, "canCreate": true }' \ "https://localhost:8443/rpc/?req=CREATE_USER" ``` ```bash # Delete a user curl -u admin:admin -X POST \ -H "Content-Type: application/json" \ -d '{"username": "johndoe"}' \ "https://localhost:8443/rpc/?req=DELETE_USER" ``` -------------------------------- ### Barnum Git Commands Source: https://github.com/gitblit-org/gitblit/blob/master/src/main/java/com/gitblit/wicket/pages/TicketPage.html This snippet shows example commands for the Barnum tool, used for Git operations like checkout, commit, push, and pull. ```bash pt checkout 123 ... git commit pt push pt pull 123 ``` -------------------------------- ### Granting Team RW Access to Repository Source: https://context7.com/gitblit-org/gitblit/llms.txt Example configuration for granting a team 'developers' Read/Write (RW) access to a specific repository 'myproject.git' and Read (R) access to 'reference.git'. This is configured in the users.conf file. ```properties // Example: Grant team RW access to repository // In users.conf: // [team "developers"] // repository = RW:myproject.git // repository = R:reference.git ``` -------------------------------- ### Configure GitBlit Properties for YouTrack Source: https://github.com/gitblit-org/gitblit/blob/master/src/main/distrib/data/groovy/youtrack-readme.md Add these properties to your `gitblit.properties` file to enable the YouTrack integration. Ensure you replace the example values with your actual YouTrack host, credentials, and project ID. ```properties groovy.customFields = "youtrackProjectID=YouTrack Project ID" youtrack.host = example.myjetbrains.com youtrack.user = ytUser youtrack.pass = insecurep@sswordsRus ``` -------------------------------- ### Custom Groovy Hook Script for Integrations Source: https://context7.com/gitblit-org/gitblit/llms.txt Create custom Groovy hook scripts for repository-specific automation. This example shows how to access custom repository fields (like Jira project and Slack webhook) and process pushed commits. It logs information and can be configured to send notifications. ```groovy // File: ${baseFolder}/groovy/custom-hook.groovy import com.gitblit.GitBlit import com.gitblit.models.RepositoryModel import com.gitblit.models.UserModel import com.gitblit.utils.JGitUtils import org.eclipse.jgit.transport.ReceiveCommand // Access custom repository fields def jiraProject = repository.customFields.jiraProject def slackWebhook = repository.customFields.slackWebhook logger.info("Custom hook triggered by ${user.username} for ${repository.name}") // Process each pushed ref for (command in commands) { def ref = command.refName def commits = JGitUtils.getRevLog( gitblit.getRepository(repository.name), command.oldId.name, command.newId.name ) // Send notification to Slack if (slackWebhook) { def payload = [ text: "${user.username} pushed ${commits.size()} commits to ${ref}", channel: "#git-notifications" ] // Post to Slack webhook } // Log to client clientLogger.info("Processed ${commits.size()} commits on ${ref}") } // Return false to reject the push, true to accept return true ``` -------------------------------- ### Fork Repository via RPC Source: https://context7.com/gitblit-org/gitblit/llms.txt Fork an existing repository to create a personal copy for the authenticated user. The fork inherits access lists from the origin for collaboration. A Java client example is also provided. ```bash # Fork a repository curl -u johndoe:password -X POST \ "https://localhost:8443/rpc/?req=FORK_REPOSITORY&name=upstream/project.git" ``` ```java # Using Java client: # RepositoryModel origin = gitblit.getRepositoryModel("upstream/project.git"); # RepositoryModel fork = gitblit.fork(origin, user); ``` -------------------------------- ### Example Commit Message Referencing YouTrack Issue Source: https://github.com/gitblit-org/gitblit/blob/master/src/main/distrib/data/groovy/youtrack-readme.md When committing changes, reference YouTrack issues using the format `#{projectID}-{issueID}`. This allows the GitBlit hook to link the commit to the specified YouTrack issue. ```git git commit -m'Changed bazinator to fix issue #fizz-34.' ``` -------------------------------- ### Initialize and push a new Git repository Source: https://github.com/gitblit-org/gitblit/blob/master/src/main/java/com/gitblit/wicket/pages/create_git.md Use these commands to create a new repository locally and link it to a remote Gitblit URL. ```bash touch README.md git init git add README.md git commit -m "first commit" git remote add origin ${primaryUrl} git push -u origin master ``` -------------------------------- ### Production Gitblit Server Startup Source: https://context7.com/gitblit-org/gitblit/llms.txt Optimized production startup for Gitblit Server using the Java server flag, increased memory allocation, and specifying the classpath for extensions. ```bash java -server -Xmx1024M \ -cp gitblit.jar:ext/* \ com.gitblit.GitBlitServer \ --baseFolder /var/gitblit \ --httpPort 80 \ --httpsPort 443 \ --dailyLogFile ``` -------------------------------- ### List Repositories via RPC Source: https://context7.com/gitblit-org/gitblit/llms.txt Use this curl command to list all repositories accessible to an authenticated user. The response is in JSON format. ```bash # List all repositories accessible to user curl -u admin:admin "https://localhost:8443/rpc/?req=LIST_REPOSITORIES" ``` -------------------------------- ### Gitblit Regex Permission Patterns Source: https://context7.com/gitblit-org/gitblit/llms.txt Demonstrates the use of regular expressions for defining flexible permission patterns in Gitblit. These patterns allow for granting access to multiple repositories based on naming conventions. ```java // Regex permission patterns: // RW:mygroup/.* - RW access to all repos in mygroup folder // R:.* - Read access to all repositories ``` -------------------------------- ### RPC API - Create Repository Source: https://context7.com/gitblit-org/gitblit/llms.txt Creates a new Git repository on the Gitblit server. Requires administrative privileges and specific server configuration. ```APIDOC ## POST /rpc/ ### Description Creates a new repository on the Gitblit server. ### Method POST ### Endpoint /rpc/ ### Query Parameters - **req** (string) - Required - Specifies the RPC request, should be "CREATE_REPOSITORY". ### Request Body - **name** (string) - Required - The name of the repository to create (e.g., "newproject.git"). - **description** (string) - Optional - A description for the repository. - **owner** (string) - Optional - The owner of the repository. - **accessRestriction** (string) - Optional - The access restriction level (e.g., "PUSH"). - **authorizationControl** (string) - Optional - The authorization control type (e.g., "NAMED"). ### Request Example ```json { "name": "newproject.git", "description": "New Project Repository", "owner": "admin", "accessRestriction": "PUSH", "authorizationControl": "NAMED" } ``` ### Response #### Success Response (200) - **status** (string) - Indicates the success of the operation. #### Response Example ```json { "status": "success" } ``` ``` -------------------------------- ### Clone and Manage via SSH Source: https://context7.com/gitblit-org/gitblit/llms.txt Access repositories using SSH with public key authentication. Default port is 29418. ```bash git clone ssh://user@localhost:29418/myrepo.git ``` ```bash git clone ssh://user@localhost:29418/myrepo.git ``` ```bash ssh -p 29418 user@localhost keys add < ~/.ssh/id_rsa.pub ``` ```bash ssh -p 29418 user@localhost keys list ``` -------------------------------- ### Review Updated Patchset with Git Source: https://github.com/gitblit-org/gitblit/blob/master/src/main/java/com/gitblit/tickets/commands.md Fetches origin and checks out the ticket branch for reviewing an updated patchset. Use --ff-only to ensure a fast-forward merge. ```bash git fetch origin && git checkout ${ticketBranch} && git pull --ff-only ``` -------------------------------- ### Download Repository Archives Source: https://context7.com/gitblit-org/gitblit/llms.txt Download repository contents as ZIP or TAR archives. Requires authentication via -u user:pass. ```bash curl -u user:pass -o repo.zip \ "https://localhost:8443/zip/?r=myrepo.git&h=HEAD" ``` ```bash curl -u user:pass -o repo.tar.gz \ "https://localhost:8443/zip/?r=myrepo.git&h=develop&format=gz" ``` ```bash curl -u user:pass -o src.zip \ "https://localhost:8443/zip/?r=myrepo.git&p=src/main&h=v1.0" ``` -------------------------------- ### Manage Teams via RPC Source: https://context7.com/gitblit-org/gitblit/llms.txt Manage teams for bulk user-repository access control. This includes listing teams, creating new teams with repository and mailing list assignments, and setting repository permissions for teams. ```bash # List all teams curl -u admin:admin "https://localhost:8443/rpc/?req=LIST_TEAMS" ``` ```bash # Create a new team curl -u admin:admin -X POST \ -H "Content-Type: application/json" \ -d '{ "name": "developers", "canAdmin": false, "canFork": true, "canCreate": true, "repositories": ["project1.git", "project2.git"], "mailingLists": ["devteam@example.com"] }' \ "https://localhost:8443/rpc/?req=CREATE_TEAM" ``` ```bash # Set repository permissions for team curl -u admin:admin -X POST \ -H "Content-Type: application/json" \ -d '[ {"registrant": "developers", "permission": "RW", "permissionType": "EXPLICIT"} ]' \ "https://localhost:8443/rpc/?req=SET_REPOSITORY_TEAM_PERMISSIONS&name=myrepo.git" ``` -------------------------------- ### Perform Git Workflow Operations Source: https://github.com/gitblit-org/gitblit/blob/master/src/main/java/com/gitblit/wicket/pages/propose_git.md Use these commands to clone a repository, create a new review branch from an integration branch, and push the changes back to the origin. ```bash git clone ${url} cd ${repo} git checkout -b ${reviewBranch} origin/${integrationBranch} ... git push -u origin ${reviewBranch} ``` -------------------------------- ### RPC API - List Repositories Source: https://context7.com/gitblit-org/gitblit/llms.txt Retrieves a list of all repositories accessible to the authenticated user, including their clone URLs and metadata. ```APIDOC ## GET /rpc/ ### Description Lists all repositories accessible to the authenticated user. ### Method GET ### Endpoint /rpc/ ### Query Parameters - **req** (string) - Required - Specifies the RPC request, should be "LIST_REPOSITORIES". ### Request Example ```bash curl -u admin:admin "https://localhost:8443/rpc/?req=LIST_REPOSITORIES" ``` ### Response #### Success Response (200) - **repository_url** (string) - The URL to clone the repository. - **name** (string) - The name of the repository. - **description** (string) - A description of the repository. - **owner** (string) - The owner of the repository. - **accessRestriction** (string) - The access restriction level (e.g., "PUSH"). - **authorizationControl** (string) - The authorization control type (e.g., "NAMED"). - **isBare** (boolean) - Indicates if the repository is bare. - **hasCommits** (boolean) - Indicates if the repository has commits. #### Response Example ```json { "https://localhost:8443/r/myrepo.git": { "name": "myrepo.git", "description": "My repository", "owner": "admin", "accessRestriction": "PUSH", "authorizationControl": "NAMED", "isBare": true, "hasCommits": true } } ``` ``` -------------------------------- ### Gitblit Server Configuration Properties Source: https://context7.com/gitblit-org/gitblit/llms.txt Key settings for Gitblit's main configuration file, gitblit.properties. Covers repository, transport, web, authentication, and mail settings. ```properties # gitblit.properties - Main configuration file # Repository settings git.repositoriesFolder = ${baseFolder}/git git.cacheRepositoryList = true git.searchRepositoriesSubfolders = true git.defaultAccessRestriction = PUSH git.allowAnonymousPushes = false git.allowCreateOnPush = true # Transport settings git.enableGitServlet = true git.daemonPort = 9418 git.sshPort = 29418 git.sshAuthenticationMethods = publickey password # Web interface settings web.siteName = My Gitblit Server web.canonicalUrl = https://git.example.com web.authenticateViewPages = false web.allowZipDownloads = true # Authentication realm.userService = ${baseFolder}/users.conf realm.passwordStorage = PBKDF2 # LDAP authentication (optional) realm.ldap.server = ldap://ldap.example.com realm.ldap.username = cn=admin,dc=example,dc=com realm.ldap.password = secret realm.ldap.accountBase = ou=users,dc=example,dc=com realm.ldap.accountPattern = (&(objectClass=person)(uid=${username})) # Mail settings mail.server = smtp.example.com mail.port = 587 mail.username = gitblit@example.com mail.password = secret mail.fromAddress = gitblit@example.com # Groovy hooks groovy.scriptsFolder = ${baseFolder}/groovy groovy.preReceiveScripts = groovy.postReceiveScripts = sendmail ``` -------------------------------- ### Federation Configuration for Gitblit Synchronization Source: https://context7.com/gitblit-org/gitblit/llms.txt Configure Gitblit federation to synchronize repositories, users, and settings between multiple Gitblit servers. This involves setting a shared passphrase and enabling proposals on the receiving server via gitblit.properties. ```bash # Configuration on receiving server (gitblit.properties): # federation.passphrase = shared-secret-key # federation.allowProposals = true # Federation pull request types: ``` -------------------------------- ### Review Rewritten Patchset with Git Source: https://github.com/gitblit-org/gitblit/blob/master/src/main/java/com/gitblit/tickets/commands.md Fetches origin and checks out the ticket branch, creating it if it doesn't exist, for reviewing a rewritten patchset. ```bash git fetch origin && git checkout -B ${ticketBranch} ``` -------------------------------- ### Track Files with Git-LFS Source: https://github.com/gitblit-org/gitblit/blob/master/src/main/java/com/gitblit/wicket/pages/FilestoreUsage.html Use this command to specify file patterns that should be tracked by Git-LFS. Files matching these patterns will be stored using the filestore. ```bash git lfs track "*.bin" ``` -------------------------------- ### Configure Git Credential Helper Source: https://github.com/gitblit-org/gitblit/blob/master/src/main/java/com/gitblit/wicket/pages/FilestoreUsage.html Configure the Git credential storage to avoid repeated password prompts when using password authentication with Git-LFS. This is particularly useful on Windows. ```bash git config --global credential.helper wincred ``` -------------------------------- ### RPC API - Fork Repository Source: https://context7.com/gitblit-org/gitblit/llms.txt Allows an authenticated user to fork an existing repository, creating a personal copy. ```APIDOC ## POST /rpc/ ### Description Forks an existing repository to create a personal copy for the authenticated user. ### Method POST ### Endpoint /rpc/ ### Query Parameters - **req** (string) - Required - Specifies the RPC request, should be "FORK_REPOSITORY". - **name** (string) - Required - The name of the repository to fork (e.g., "upstream/project.git"). ### Request Example ```bash curl -u johndoe:password -X POST "https://localhost:8443/rpc/?req=FORK_REPOSITORY&name=upstream/project.git" ``` ### Response #### Success Response (200) - **status** (string) - Indicates the success of the operation. #### Response Example ```json { "status": "success" } ``` ### Notes - The fork is typically created under the user's namespace (e.g., `~johndoe/project.git`). - The forked repository inherits access lists from the origin for collaboration. ``` -------------------------------- ### Gitblit Ticket Service Configuration and Usage Source: https://context7.com/gitblit-org/gitblit/llms.txt Gitblit's integrated ticket system supports issue tracking and code review. This section outlines configuration options in gitblit.properties for different ticket service implementations (File, Branch, Redis) and ticket handling. It also shows how to close tickets via commit messages and lists available ITicketService interface methods. ```java // Available ticket service implementations: // - FileTicketService: Stores tickets in filesystem // - BranchTicketService: Stores tickets in a Git branch // - RedisTicketService: Stores tickets in Redis // Configuration in gitblit.properties: // tickets.service = com.gitblit.tickets.BranchTicketService // tickets.acceptNewTickets = true // tickets.acceptNewPatchsets = true // Push a patchset for code review (Gerrit-style) // git push origin HEAD:refs/for/master // Ticket status workflow: // New -> Open -> Resolved/Closed/Declined // Close ticket via commit message: // "Fixes #123" or "Closes #42" // Pattern: tickets.closeOnPushCommitMessageRegex // ITicketService interface methods: // getTicket(repository, ticketId) - Get ticket by ID // createTicket(repository, change) - Create new ticket // updateTicket(repository, ticketId, change) - Update ticket // deleteTicket(repository, ticketId) - Delete ticket // getTickets(repository, filter) - Query tickets // searchTickets(repository, query, page, pageSize) - Lucene search ``` -------------------------------- ### RPC API - User Management Source: https://context7.com/gitblit-org/gitblit/llms.txt Provides endpoints for managing user accounts, including listing, retrieving, creating, and deleting users. ```APIDOC ## User Management Endpoints ### List All Users #### Method GET #### Endpoint /rpc/ #### Query Parameters - **req** (string) - Required - Specifies the RPC request, should be "LIST_USERS". #### Request Example ```bash curl -u admin:admin "https://localhost:8443/rpc/?req=LIST_USERS" ``` ### Get Specific User #### Method GET #### Endpoint /rpc/ #### Query Parameters - **req** (string) - Required - Specifies the RPC request, should be "GET_USER". - **name** (string) - Required - The username of the user to retrieve. #### Request Example ```bash curl -u admin:admin "https://localhost:8443/rpc/?req=GET_USER&name=johndoe" ``` ### Create User #### Method POST #### Endpoint /rpc/ #### Query Parameters - **req** (string) - Required - Specifies the RPC request, should be "CREATE_USER". #### Request Body - **username** (string) - Required - The username for the new user. - **password** (string) - Required - The password for the new user. - **displayName** (string) - Optional - The display name of the user. - **emailAddress** (string) - Optional - The email address of the user. - **canAdmin** (boolean) - Optional - Whether the user has administrative privileges. - **canFork** (boolean) - Optional - Whether the user can fork repositories. - **canCreate** (boolean) - Optional - Whether the user can create repositories. #### Request Example ```json { "username": "johndoe", "password": "secretpass", "displayName": "John Doe", "emailAddress": "john@example.com", "canAdmin": false, "canFork": true, "canCreate": true } ``` ### Delete User #### Method POST #### Endpoint /rpc/ #### Query Parameters - **req** (string) - Required - Specifies the RPC request, should be "DELETE_USER". #### Request Body - **username** (string) - Required - The username of the user to delete. #### Request Example ```json { "username": "johndoe" } ``` ``` -------------------------------- ### Stop Gitblit GO Server Source: https://context7.com/gitblit-org/gitblit/llms.txt Command to gracefully stop the running Gitblit GO server. Requires the shutdown port to be configured. ```bash java -jar gitblit.jar --stop --shutdownPort 8081 ``` -------------------------------- ### Git Daemon Protocol Access Source: https://context7.com/gitblit-org/gitblit/llms.txt Serve repositories via the native Git protocol for anonymous read-only access. ```bash git clone git://localhost:9418/public-repo.git ``` -------------------------------- ### Groovy Hook Script Configuration Source: https://context7.com/gitblit-org/gitblit/llms.txt Configure post-receive email notifications using the built-in sendmail hook script. ```groovy // File: groovy/sendmail.groovy (included with Gitblit) // Automatically sends email on push when configured // Configuration in gitblit.properties: // groovy.postReceiveScripts = sendmail // mail.server = smtp.example.com // mail.port = 587 // mail.username = notifications@example.com // mail.password = secret // mail.fromAddress = gitblit@example.com // mail.mailingLists = team@example.com // Per-repository configuration in .git/config: // [hooks] // mailinglist = dev@example.com, qa@example.com // emailprefix = [MyProject] // Bound variables available in hook scripts: // gitblit - Gitblit Server (com.gitblit.GitBlit) // repository - Repository Model (com.gitblit.models.RepositoryModel) // receivePack - JGit Receive Pack // user - Gitblit User (com.gitblit.models.UserModel) // commands - JGit commands (Collection) // url - Base URL for Gitblit // logger - SLF4J Logger // clientLogger - Logs messages to Git client ``` -------------------------------- ### Clone and Push via HTTP/HTTPS Source: https://context7.com/gitblit-org/gitblit/llms.txt Perform standard Git operations over HTTP. Authentication is required for repositories with restricted access. ```bash git clone https://localhost:8443/r/public-repo.git ``` ```bash git clone https://user:password@localhost:8443/r/private-repo.git ``` ```bash git clone https://localhost:8443/git/myrepo.git ``` ```bash cd myrepo git add . git commit -m "Update" git push origin master ``` ```bash git push https://admin:pass@localhost:8443/r/newrepo.git master ``` -------------------------------- ### Retrieve Repository RSS Feeds Source: https://context7.com/gitblit-org/gitblit/llms.txt Use these curl commands to fetch commit, branch, tag, or search-filtered feeds from a Gitblit repository. ```bash curl "https://localhost:8443/feed/myrepo.git" ``` ```bash curl "https://localhost:8443/feed/myrepo.git?h=refs/heads/develop&l=50" ``` ```bash curl "https://localhost:8443/feed/myrepo.git?ot=TAG" ``` ```bash curl "https://localhost:8443/feed/myrepo.git?s=bugfix&st=COMMIT" ``` ```bash curl "https://localhost:8443/feed/myrepo.git?pg=2&l=25" ``` -------------------------------- ### RPC API - Team Management Source: https://context7.com/gitblit-org/gitblit/llms.txt Manages teams for bulk user-repository access control, including listing and creating teams, and setting repository permissions. ```APIDOC ## Team Management Endpoints ### List All Teams #### Method GET #### Endpoint /rpc/ #### Query Parameters - **req** (string) - Required - Specifies the RPC request, should be "LIST_TEAMS". #### Request Example ```bash curl -u admin:admin "https://localhost:8443/rpc/?req=LIST_TEAMS" ``` ### Create Team #### Method POST #### Endpoint /rpc/ #### Query Parameters - **req** (string) - Required - Specifies the RPC request, should be "CREATE_TEAM". #### Request Body - **name** (string) - Required - The name of the team. - **canAdmin** (boolean) - Optional - Whether the team has administrative privileges. - **canFork** (boolean) - Optional - Whether the team can fork repositories. - **canCreate** (boolean) - Optional - Whether the team can create repositories. - **repositories** (array of strings) - Optional - List of repository names the team has access to. - **mailingLists** (array of strings) - Optional - List of mailing lists associated with the team. #### Request Example ```json { "name": "developers", "canAdmin": false, "canFork": true, "canCreate": true, "repositories": ["project1.git", "project2.git"], "mailingLists": ["devteam@example.com"] } ``` ### Set Repository Team Permissions #### Method POST #### Endpoint /rpc/ #### Query Parameters - **req** (string) - Required - Specifies the RPC request, should be "SET_REPOSITORY_TEAM_PERMISSIONS". - **name** (string) - Required - The name of the repository. #### Request Body - An array of permission objects, where each object specifies: - **registrant** (string) - Required - The name of the team. - **permission** (string) - Required - The permission level (e.g., "RW"). - **permissionType** (string) - Required - The type of permission (e.g., "EXPLICIT"). #### Request Example ```json [ {"registrant": "developers", "permission": "RW", "permissionType": "EXPLICIT"} ] ``` ``` -------------------------------- ### Gitblit Authorization Control Methods Source: https://context7.com/gitblit-org/gitblit/llms.txt Specifies the methods for controlling authorization in Gitblit. These determine how access is granted based on named users/teams or general authentication status. ```java // Authorization control: // NAMED - Only explicitly named users/teams have access // AUTHENTICATED - Any authenticated user has restricted access ``` -------------------------------- ### Gitblit Access Permission Codes Source: https://context7.com/gitblit-org/gitblit/llms.txt Defines the available access permission codes used in Gitblit for granular control. These codes specify the level of access granted to users or teams for repositories. ```java // Access permission codes: // N - NONE (no access) // X - EXCLUDE (explicitly denied) // V - VIEW (web UI, RSS, download zip) // R - CLONE (read/pull) // RW - PUSH (read/write) // RWC - CREATE (push with ref creation) // RWD - DELETE (push with ref deletion) // RW+ - REWIND (push with force/rewind) ``` -------------------------------- ### Git Commit Details Source: https://github.com/gitblit-org/gitblit/blob/master/src/main/java/com/gitblit/wicket/pages/TicketPage.html Displays commit ID, diff link, title, and dates for a Git commit within the Barnum interface. ```html

([](#ptModal)) [avatar] [author] [commit id][diff] [title] [commit date] [patch date] [](#bodyCheckout) [](#) [author][] (#bodyPatchset) [change type] [commit path] | #### Git **:** **:** * * * #### Barnum ([](#ptModal)) [avatar] [author] [what happened] [revision type] [R1] [patch date] [](#) * approve * looks good * needs improvement * veto [](#bodyInstructions) * * * #### Git **:** **:** **:** * * * #### Barnum ([](#ptModal)) ``` -------------------------------- ### Gitblit Access Restriction Types Source: https://context7.com/gitblit-org/gitblit/llms.txt Outlines the different types of access restrictions that can be applied to repositories in Gitblit. These settings control anonymous and authenticated access levels. ```java // Access restriction types: // NONE - Anonymous view, clone, and push // PUSH - Anonymous view/clone, authenticated push // CLONE - Anonymous view, authenticated clone/push // VIEW - Authenticated view, clone, and push ``` -------------------------------- ### Trigger Jenkins Builds with Groovy Hook Source: https://context7.com/gitblit-org/gitblit/llms.txt Use this Groovy script to automatically trigger Jenkins builds after Git pushes. Configure Gitblit properties for Jenkins server URL, token, and Git base URL. Requires Jenkins Git plugin 1.1.14+ and Git SCM polling configured in Jenkins. ```groovy // File: groovy/jenkins.groovy // Configuration in gitblit.properties: // groovy.postReceiveScripts = jenkins // groovy.jenkinsServer = http://jenkins.example.com:8080 // groovy.jenkinsToken = your-jenkins-token // groovy.jenkinsGitbaseurl = https://gitblit.example.com/r // The script triggers Jenkins Git plugin notification: def jenkinsUrl = gitblit.getString('groovy.jenkinsServer', 'http://yourserver/jenkins') def jenkinsToken = gitblit.getString('groovy.jenkinsToken', 'yourtoken') def jenkinsGitbaseurl = gitblit.getString('groovy.jenkinsGitbaseurl', "${url}/r") def triggerUrl = jenkinsUrl + "/git/notifyCommit?url=" + jenkinsGitbaseurl + "/${repository.name}" + "&token=" + jenkinsToken new URL(triggerUrl).getContent() // Requires Jenkins Git plugin 1.1.14 or later // Jenkins job must be configured with Git SCM polling ``` -------------------------------- ### Set MX_COLOR Environment Variable Source: https://github.com/gitblit-org/gitblit/blob/master/README.markdown Set the MX_COLOR environment variable to true to enable ANSI color output in the Ant build console. This is useful for visually distinguishing build output. ```shell set MX_COLOR=true ``` -------------------------------- ### Protect Git References with Groovy Hook Source: https://context7.com/gitblit-org/gitblit/llms.txt This Groovy script prevents unauthorized modifications to protected branches and tags. Define protected reference patterns and authorized teams in the script. Pushes to protected refs by unauthorized users will be rejected. ```groovy // File: groovy/protect-refs.groovy // Configuration: groovy.preReceiveScripts = protect-refs // Define protected ref patterns and authorized teams def protectedCmds = [ UPDATE_NONFASTFORWARD: Result.REJECTED_NONFASTFORWARD, DELETE: Result.REJECTED_NODELETE ] def protectedRefs = [ "refs/heads/master", "refs/heads/main", "refs/tags/.+" // Protect all tags ] def authorizedTeams = ["admins", "release-managers"] for (ReceiveCommand command : commands) { def updateType = command.type def updatedRef = command.refName def refPattern = protectedRefs.find { updatedRef.matches ~it } def result = protectedCmds[updateType.name()] if (refPattern && result) { def team = authorizedTeams.find { user.isTeamMember it } if (!team) { command.setResult(result, "${user.username} cannot ${updateType} protected ref ${updatedRef}") } } } ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.