| Crates.io | gitlab-branch-gen |
| lib.rs | gitlab-branch-gen |
| version | 1.0.0 |
| created_at | 2025-09-21 17:57:24.001403+00 |
| updated_at | 2025-09-21 17:57:24.001403+00 |
| description | Gitlab Branch Gen is a CLI Tool to create the same branch name in multiple repositories. It allows to create a config and repeat the action. This is useful for branch based releases |
| homepage | https://github.com/stefhol/gitlab-branch-gen |
| repository | https://github.com/stefhol/gitlab-branch-gen |
| max_upload_size | |
| id | 1849003 |
| size | 82,078 |
gitlab-branch-gen streamlines the process of creating a new branch in several GitLab projects at once. You can specify repositories and credentials via a configuration file or command-line arguments, making repetitive tasks effortless.
cargo install gitlab-branch-gen
git clone https://github.com/stefhol/gitlab-branch-gen.git
cd gitlab-branch-gen
cargo install --path .
The tool can be configured using a file located at ~/.config/branch-gen/config.yml.
Example config.yml:
gitlab_url: "https://gitlab.com"
gitlab_api_key: "your_personal_access_token"
repos:
- "stefhol/test"
- "stefhol/1234"
- "inkscape/inkscape"
gitlab_api_key: Your GitLab Personal Access Token with api scope.gitlab_url: The base URL of your GitLab instance.repos: A list of repositories formatted as namespace/project.Arguments passed on the command line will override the values in the configuration file. You can write the provided command-line arguments to the config file by using the --update-config flag.
Creates a defined branch in multiple gitlab repos. Config can be placed in `~/.config/branch-gen/config.yml`.
Usage: gitlab-branch-gen [OPTIONS] [BRANCH_NAME]
Arguments:
[BRANCH_NAME] The Branch name to create
Options:
--repos <REPOS> The List of repos to change
--gitlab-api-key <GITLAB_API_KEY> The Api Key from gitlab
--gitlab-url <GITLAB_URL> The gitlab instance to use
-u, --update-config If provided writes to the config
-c, --config <FILE> Overwrites the default config file location
-h, --help Print help
-V, --version Print version
This example will attempt to create the test branch in the configured repositories.
gitlab-branch-gen test
Output:
Branch to create: test
Gitlab Instance: https://gitlab.com
Repositories to change:
- stefhol/test
- stefhol/1234
- stefhol/release
- inkscape/inkscape
Gathering plan on creating branch test
https://gitlab.com/stefhol/test ⚠️ Branch exists ⚠️
stefhol/1234: Skipped Failure on retrieving information
stefhol/release: Skipped Failure on retrieving information
https://gitlab.com/inkscape/inkscape ✅
Execute? Type y to confirm
y
stefhol/test: skipped
stefhol/1234: skipped
stefhol/release: skipped
inkscape/inkscape: https://gitlab.com/inkscape/inkscape error ⛔
This project is licensed under the MIT License. See the LICENSE file for details.