Skip to main content

Manage nested git repositories in Gitlab seemlessly(ish)

Project description

gitconductor

tests Coverage License Ruff Documentation

gitconductor is a command-line tool and Python library for managing git operations over nested GitLab groups using the official GitLab Python API. It makes it easy to traverse complex group hierarchies, perform recursive git operations, without the need for submodule interdependencies, accessing only the sub-groups/projects for which the user has access.

Documentation.

Features

  • Recursive group traversal — operate on entire GitLab group trees, not just individual projects
  • Git operations across nested groups (clone, pull, status, etc.)
  • Unified CLI and Python API
  • Built on top of the official GitLab Python API
  • Designed for automation, scripting, and bulk maintenance

Installation

pip install gitconductor

Configuration

GitLab API Keys

Keys can be set up in two ways:

  1. Via an environment variable: export GITLAB_API_KEY=<my-private-key>
  2. Via the "gitconductor.yaml" file.

Usage (CLI)

Clone

To clone a Gitlab project at, for example, https://gitlab.com/ejb90-group.

gitconductor clone ejb90-group

Branch

gitconductor branch <name>

Checkout

gitconductor checkout <name>

Pull

...

Visualisation

Tree

To visualise the hierarchy of Groups/Projects as a Run, run:

gitconductor viz tree

Results in:

ejb90-group
└── models
    ├── model-a
    ├── model-b
    ├── model-c
    └── subgroup-1
        ├── model-a
        └── model-b

Table

To visualise the hierarchy of Groups/Projects as a Table, run:

gitconductor viz table

Results in:

┏━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┓
┃ Name          ┃ Tree                                  ┃ Branch ┃ Path                                  ┃ Remote                                                              ┃
┡━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━┩
│ model-a       │ ejb90-group/models/model-a            │ main   │ ejb90-group/models/model-a            │ git@gitlab.com:ejb90-group/models/model-a.git                       │
│ model-b       │ ejb90-group/models/model-b            │ main   │ ejb90-group/models/model-b            │ git@gitlab.com:ejb90-group/models/model-b.git                       │
│ model-c       │ ejb90-group/models/model-c            │ main   │ ejb90-group/models/model-c            │ git@gitlab.com:ejb90-group/models/model-c.git                       │
│ model-a       │ ejb90-group/models/subgroup-1/model-a │ main   │ ejb90-group/models/subgroup-1/model-a │ git@gitlab.com:ejb90-group/models/subgroup-1/subgroup-1-model-a.git │
│ model-b       │ ejb90-group/models/subgroup-1/model-b │ main   │ ejb90-group/models/subgroup-1/model-b │ git@gitlab.com:ejb90-group/models/subgroup-1/subgroup-1-model-b.git │
└───────────────┴───────────────────────────────────────┴────────┴───────────────────────────────────────┴─────────────────────────────────────────────────────────────────────┘

Access

To see who has access to a given hierarchy of Groups/Projects, run:

gitconductor viz access

Results in:

┏━━━━━━━━━━━━━━━━━━━━┳━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━━━━━━━┳━━━━━━━━┓
┃ Group/Project      ┃ User  ┃ Access Level ┃ Public Email ┃ Expiry ┃
┡━━━━━━━━━━━━━━━━━━━━╇━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━━━━━━━╇━━━━━━━━┩
│ ejb90-group        │ Ellis │ Owner        │              │        │
│ ejb90-group/models │ mobot │ Reporter     │              │        │
└────────────────────┴───────┴──────────────┴──────────────┴────────┘

Usage (Python API)

group = gitlab.GitlabGroup(
    gitlab_url=ctx.obj["url"],
    gitlab_key=ctx.obj["key"],
    name=name,
    root=directory,
)
group.recursive_command("clone")

Development & Contributing

Contributions welcome — feel free to open issues or submit PRs.

License

MIT License • © 2026

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gitconductor-0.1.0rc16.tar.gz (15.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gitconductor-0.1.0rc16-py3-none-any.whl (15.6 kB view details)

Uploaded Python 3

File details

Details for the file gitconductor-0.1.0rc16.tar.gz.

File metadata

  • Download URL: gitconductor-0.1.0rc16.tar.gz
  • Upload date:
  • Size: 15.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.2.0 CPython/3.13.11

File hashes

Hashes for gitconductor-0.1.0rc16.tar.gz
Algorithm Hash digest
SHA256 a772c367a6be72c5fa126ecfc347a9d719368aa873eb144c614ed3e45be529d7
MD5 4e47290b8ba1864c98eb7c28cd346c83
BLAKE2b-256 11a3ba7d8508d3ad4e5702e8693e17a6b2437e8ca755dde7666aead76a89dbcf

See more details on using hashes here.

File details

Details for the file gitconductor-0.1.0rc16-py3-none-any.whl.

File metadata

File hashes

Hashes for gitconductor-0.1.0rc16-py3-none-any.whl
Algorithm Hash digest
SHA256 1b13be23019b2e4150243e47c0e478e6dd0e8140b6107c52f4831e7f0bd8d35b
MD5 4402be3fb6e5393b6fd257b65f20669b
BLAKE2b-256 700cb3765f8e5192104b1a69557177e5e58e04764bae1744e4c0a5c4dcd8ca9a

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page