Metadata-Version: 2.4
Name: git_fleet_manager
Version: 0.1.2
Summary: A command line tool for managing several git repositories at once
Author-email: Kai Diefenbach <kai.diefenbach@iqpp.de>
License-Expression: MIT
Project-URL: Homepage, https://github.com/diefenbach/git-fleet-manager
Classifier: Programming Language :: Python :: 3
Classifier: Operating System :: OS Independent
Classifier: Environment :: Console
Requires-Python: >=3.6
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: dev
Requires-Dist: pytest>=7.0.0; extra == "dev"
Requires-Dist: pytest-cov>=4.0.0; extra == "dev"
Requires-Dist: pytest-mock>=3.10.0; extra == "dev"
Requires-Dist: black>=23.0.0; extra == "dev"
Requires-Dist: ruff>=0.0.200; extra == "dev"
Requires-Dist: bandit>=1.7.0; extra == "dev"
Requires-Dist: pre-commit>=3.0.0; extra == "dev"
Requires-Dist: detect-secrets>=1.4.0; extra == "dev"
Dynamic: license-file

# git-fleet-manager

git-fleet-manager is a command-line tool for managing multiple Git repositories at once. It allows you to perform common Git operations such as checking the status, pulling, pushing, and viewing commit logs across multiple repositories in a specified directory.

[![GitHub Repository](https://img.shields.io/badge/GitHub-Repository-blue.svg)](https://github.com/diefenbach/git-fleet-manager)

## Features

- **Recursive Repository Discovery**: Automatically finds all Git repositories in a directory and its subdirectories.
- **Selective Repository Management**: Use a `.gfm` file to specify which repositories to manage.
- **Batch Operations**:
  - Check the status of all repositories.
  - Pull changes from remote repositories.
  - Push changes to remote repositories.
  - View commit logs for all repositories.

## Installation

1. Install git-fleet-manager using pip:
    ```bash
    pip install git-fleet-manager
    ```

2. Verify the installation:
    ```bash
    gfm --version
    ```

3. git-fleet-manager is now ready to use. Run the `gfm` command from anywhere in your terminal.


## Usage

Run the `gfm` command with the desired subcommand and options.

### Commands

#### `status`
Check the status of all repositories in the specified directory.

```bash
gfm status [directory]
```

- **directory**: The directory to scan for repositories (default: current directory).

#### `pull`
Pull changes for all repositories in the specified directory.

```bash
gfm pull [directory]
```

- **directory**: The directory to scan for repositories (default: current directory).

#### `push`
Push changes for all repositories in the specified directory.

```bash
gfm push [directory]
```

- **directory**: The directory to scan for repositories (default: current directory).

#### `log`
View the commit log for all repositories in the specified directory.

```bash
gfm log [directory] [--max-commits MAX_COMMITS]
```

- **directory**: The directory to scan for repositories (default: current directory).
- **--max-commits**: The maximum number of commits to display for each repository (default: 10).

#### `--version`
Display the current version of git-fleet-manager.

```bash
gfm --version
```

### `.gfm` File

If a `.gfm` file exists in the specified directory, only the repositories listed in the file will be managed. The file should contain one repository path per line, relative to the directory containing the `.gfm` file.

Example `.gfm` file:
```
repo1
subdir/repo2
```

### Examples

1. Check the status of all repositories in the current directory:
   ```bash
   gfm status
   ```

2. Pull changes for all repositories in `/projects`:
   ```bash
   gfm pull /projects
   ```

3. Push changes for repositories listed in a `.gfm` file:
   ```bash
   gfm push /projects
   ```

4. View the last 5 commits for all repositories:
   ```bash
   gfm log /projects --max-commits 5
   ```

5. Display the version of git-fleet-manager:
   ```bash
   gfm --version
   ```

## Project Structure

```
git_fleet_manager/
├── git_utils.py       # Utility functions for Git operations
├── cli.py             # Command-line interface for git-fleet-manager
└── __init__.py        # Package initialization and versioning
```

## Source Code

The source code is available on GitHub at [https://github.com/diefenbach/git-fleet-manager](https://github.com/diefenbach/git-fleet-manager).

## Contributing

Contributions are welcome! Feel free to open issues or submit pull requests to improve git-fleet-manager.

## License

This project is licensed under the MIT License. See the `LICENSE` file for details.

## Acknowledgments

git-fleet-manager was developed to simplify the management of multiple Git repositories, making it easier to perform batch operations efficiently.
