Skip to content

gko/brick

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

brick — A Git Submodule Package Manager

tests

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.

Features

  • Simple Installation: Add new submodules (bricks) using a simple shorthand.
  • Global Init: Install all missing bricks defined in .gitmodules with 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 -y or --yes flag to skip confirmation prompts for dirty checks and deletions.

Installation

Quick Start (One-liner)

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 ~/.bashrc

For 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

Manual Installation

  1. Clone this repository or download the brick.sh script.
git clone https://github.com/gko/brick.git
  1. Source the brick.sh script 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
  1. Restart your shell or source the configuration file for the changes to take effect:
source ~/.zshrc

or

source ~/.bashrc

With zinit

In your .zshrc:

zinit light gko/brick

With antigen

In your .zshrc:

antigen bundle gko/brick

Usage

Usage: 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

License

This project is open source and available under the GPLv3 license.

About

A frictionless package manager for Git submodules.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages