madgit 0.3.0

Mass run git distributed across multiple repositories.
# madgit

`madgit` is a CLI tool that lets you run Git commands distributed across multiple repositories at once.
Instead of navigating into each directory, you can run a single `madgit [dir]` command to perform operations on every repository within a specified directory.

## Commands

- `clone --file <path>`: Clones repositories from a list in a file to the target directory.
- `clone --github <username>`: Clones all repositories from a GitHub user or organization.
- `pull`: Runs `git pull` in each repository.
- `fetch`: Runs `git fetch --all` in each repository.
- `status`: Runs `git status` in each repository (headers are color-coded: red=needs-sync, yellow=changes, cyan=clean).
- `push`: Runs `git push` in each repository.
- `checkout <branch>`: Runs `git checkout <branch>` in each repository.
- `stash [subcommand]`: Runs `git stash` with a given subcommand (`push`, `pop`, `apply`, `list`, `show`) in each repository. Defaults to `push`.
- `exec -- <command>`: Executes any arbitrary command in each repository.
- `no-git`: Lists subdirectories which are not git repositories.

**Note:** If no directory is specified, the current directory will be used.

## Examples

```sh
# Clone repositories from a file to ~/projects
madgit ~/projects clone --file repos.txt

# Clone all repos from a GitHub organization
madgit ~/projects clone --github gotopkg

# Clone from a GitLab user
madgit ~/projects clone --gitlab wykwit

# Pull all repositories in current directory
madgit pull

# Pull all repositories in ~/projects
madgit ~/projects pull

# Check status of all repositories in current directory
madgit status

# Execute custom command in all repositories
madgit ~/projects exec -- git log --oneline -5
```

## Installation

### with cargo

`madgit` is available on crates.io: <https://crates.io/crates/madgit>

```sh
cargo install madgit
```

### from AUR

```sh
paru -S madgit
```

### from source

To build `madgit` from source, you'll need the [Rust toolchain](https://www.rust-lang.org/tools/install).

1. Clone the repository:
    ```sh
    git clone https://gitlab.com/wykwit/madgit.git && cd madgit
    ```

2. Build the project:
    ```sh
    cargo build --release
    ```

3. You will find the executable in:
    ```sh
    ./target/release/madgit
    ```

## License

This project is licensed under the MIT License.

```
MIT License

Copyright (c) 2025 wykwit

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
```