brick is a frictionless wrapper for Git Submodules. It simplifies the process of adding, updating, and removing submodules, treating them as "bricks" that you can easily plug into your project.
- Simple Installation: Add new submodules (bricks) using a simple shorthand.
- Global Init: Install all missing bricks defined in
.gitmoduleswith a single command. - Smart Updates: Update specific bricks or all of them to their latest tracking commits.
- Branch Tracking: Automatically keeps bricks on their tracked branches after updates, avoiding detached HEAD states.
- Safe Removal: Cleanly purge a brick from the repository, including its internal git metadata.
- Quick Overview: List all installed bricks, their current branches, and remote URLs in a clean table.
- Automation Friendly: Use the
-yor--yesflag to skip confirmation prompts for dirty checks and deletions.
Run this to download brick and add it to your shell configuration:
curl -sLo ~/.brick.sh https://raw.githubusercontent.com/gko/brick/master/brick.sh
echo 'source ~/.brick.sh' >> ~/.zshrc # or ~/.bashrcFor Zsh users, you can also install the completion script:
mkdir -p ~/.zsh/completions
curl -sLo ~/.zsh/completions/_brick https://raw.githubusercontent.com/gko/brick/master/_brick- Clone this repository or download the
brick.shscript.
git clone https://github.com/gko/brick.git- Source the
brick.shscript in your shell's configuration file (e.g.,~/.bashrc,~/.zshrc). Add the following line:
# Make sure to use the correct path to where you cloned the repo
source /path/to/brick/brick.sh- Restart your shell or source the configuration file for the changes to take effect:
source ~/.zshrcor
source ~/.bashrcWith zinit
In your .zshrc:
zinit light gko/brickWith antigen
In your .zshrc:
antigen bundle gko/brickUsage: brick [command] [target] [flags]
Commands:
install, i, add Install a brick (run empty to init all missing)
update, up, upgrade Update a brick (run empty to update all)
delete, rm, remove Safely purge a brick from the repository
list, ls List all installed bricks
Flags:
-y, --yes Skip confirmation prompts (dirty checks/deletions)
-b, --branch Specify a target branch (e.g., -b dev)
Example:
brick install gko/postfix # Install a brick from GitHub
brick install # Install all missing bricks
brick update -y # Update all bricks without prompts
brick update my-brick main # Update 'my-brick' to the 'main' branch
brick rm ghost-theme # Remove the 'ghost-theme' brick
brick ls # List all installed bricks
This project is open source and available under the GPLv3 license.