gitctl is a command-line interface (CLI) tool designed to simplify and streamline your GitLab workflow. It is built with Go and is designed to be easy to use and highly efficient.
- Base Path Config: Define base paths for all your GitLab projects (
gitctl.yaml) - Search Git Repositories:
gitctlwill search for Git repositories in the base paths you've defined - Run Git Commands:
gitctlwill run Git commands on the repositories found in the base paths
Currently, gitctl supports the following Git commands:
git statusgit pull
go install github.com/bjoernkarma/gitctl@latest
Download the latest release for your platform from the Releases page,
then extract and move the gitctl binary to any place in your $PATH.
To install gitctl, follow these steps:
- Clone the repository:
git clone git@github.com:BjoernKarma/gitctl.git - Navigate to the cloned directory:
cd gitctl - Build the project:
go build - Install the CLI:
go install
gitctl searches for gitctl.yaml in this order:
- Current working directory
~/.config/gitctl/
You can also pass an explicit file with --config /path/to/gitctl.yaml.
Create ~/.config/gitctl/gitctl.yaml with the following format:
# Verbosity settings
verbosity:
quiet: false
verbose: false
debug: true
# Run mode settings
run_mode:
local: true
dry_run: false
concurrency: 3
# Output settings
output:
color: true
# Base directories for git repositories
base_dirs:
- "//dev//gitctl"Environment variables use the GITCTL_ prefix. Dots in config keys are mapped to underscores.
Examples:
verbosity.verbose->GITCTL_VERBOSITY_VERBOSErun_mode.local->GITCTL_RUN_MODE_LOCALrun_mode.dry_run->GITCTL_RUN_MODE_DRY_RUNoutput.color->GITCTL_OUTPUT_COLOR
Configuration values are resolved in this order (highest to lowest):
- CLI flags
- Environment variables
- Config file
- Built-in defaults
Here's how you can use gitctl:
gitctl [command] [arguments]For more information about the commands, use:
gitctl --helpRun git commands on multiple git repositories.
For example, you can run 'gitctl pull' to pull all the git
repositories in the base directories.
Usage:
gitctl [command]
Available Commands:
completion Generate the autocompletion script for the specified shell
help Help about any command
pull Execute git pull on multiple git repositories.
status Execute git status on multiple git repositories.
Flags:
--config string config file (default search: ./gitctl.yaml, then ~/.config/gitctl/gitctl.yaml)
-h, --help help for gitctl
-q, --quiet suppress output
-v, --verbose verbose output
-d, --debug debug output
-l, --local run with working directory used as base directory
-D, --dryRun run with dry run mode
-c, --color color output (default true)
-C, --concurrency number of concurrent operations (default "1")
--base.dirs base directories for git repositories
--version version for gitctl
Use "gitctl [command] --help" for more information about a command.
We welcome contributions to gitctl. If you'd like to contribute, please submit a merge request with your changes.
If you encounter any problems or have any questions, please open an issue on our GitLab page.
gitctl is currently under active development. We're always looking for feedback and suggestions for new features.