Skip to main content

Discover, track, and sync Git repos across GitHub, GitLab, and Gitea

Project description

git-proj

Discover, track, and sync Git repos across GitHub, GitLab, and Gitea from one CLI.

Why

If you juggle between different projects and work across multiple Git foundries — GitHub, a company GitLab, a self-hosted Gitea — you may lose track of what lives where and what you've been working on recently.

git-proj gives you one place to discover repos via APIs, pick which ones to track, and keep them synced locally.

Install

Requires Python 3.11+ and uv.

uv tool install git-proj

Or from source:

git clone https://github.com/sjev/git-projects.git
cd git-projects
uv sync --frozen

The CLI command is gpr.

Quick start

# Create config with default foundries
gpr config init

# Edit ~/.local/share/git-projects/config.yaml to add your API tokens

# Fetch all repos from configured foundries
gpr fetch

# Browse what's available (tracked projects are highlighted with their path)
gpr list
gpr list myproject    # filter by name

# Track a repo by name (resolved from index) or URL
gpr track my-repo
gpr track git@github.com:user/repo.git

# Clone missing repos, pull & push existing ones
gpr sync

# Stop tracking
gpr untrack my-repo

Commands

Command Description
config init Create default config file
config show Show config path and contents
fetch [foundry] Fetch repos from foundry APIs, save to local index
list [query] Browse indexed repos (tracked projects highlighted with path)
track <name|url> [--path] Add a project to tracking
untrack <name> Remove a project from tracking
sync [--workers N] Clone missing repos, pull & push existing tracked repos
info Show version, paths, and repo counts

Configuration

Config lives at $XDG_DATA_HOME/git-projects/ (typically ~/.local/share/git-projects/):

config.yaml      # foundries, clone_root, credentials — never share this
projects.json    # tracked projects (portable, no secrets)
index.json       # cached repo metadata from last fetch

Example config.yaml:

clone_root: ~/projects
clone_url_format: ssh    # or "https"
foundries:
  - name: github
    type: github
    token: ghp_...
  - name: my-gitea
    type: gitea
    url: https://gitea.example.com
    token: ""

Multi-machine setup

projects.json is portable (relative paths, no secrets). Copy it between machines:

scp ~/.local/share/git-projects/projects.json other-machine:~/.local/share/git-projects/
gpr sync

Development

uv sync --group dev
uv run invoke lint      # ruff check + ruff format --check + mypy
uv run invoke test      # pytest with coverage
uv run invoke format    # ruff format

Versioning

Bump the version with bump-my-version:

uv run invoke bump           # patch: 0.1.0 → 0.1.1
uv run invoke bump --part minor  # minor: 0.1.0 → 0.2.0
uv run invoke bump --part major  # major: 0.1.0 → 1.0.0

Each bump updates pyproject.toml, creates a git commit, and tags the release.

License

MIT

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

git_proj-0.6.2.tar.gz (11.6 kB view details)

Uploaded Source

Built Distribution

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

git_proj-0.6.2-py3-none-any.whl (17.3 kB view details)

Uploaded Python 3

File details

Details for the file git_proj-0.6.2.tar.gz.

File metadata

  • Download URL: git_proj-0.6.2.tar.gz
  • Upload date:
  • Size: 11.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.8

File hashes

Hashes for git_proj-0.6.2.tar.gz
Algorithm Hash digest
SHA256 6a13fbc18a9ac7ad05cca7f30a44e055f2f5862f5fb4fcd303f8b74e7183cc92
MD5 6daa9a2bf476631ae043af9195e4150f
BLAKE2b-256 46f6fbe6cf4f0f2c4f10522759a3f12f239d13d159e50f3aa0a640996247777f

See more details on using hashes here.

File details

Details for the file git_proj-0.6.2-py3-none-any.whl.

File metadata

  • Download URL: git_proj-0.6.2-py3-none-any.whl
  • Upload date:
  • Size: 17.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.8.8

File hashes

Hashes for git_proj-0.6.2-py3-none-any.whl
Algorithm Hash digest
SHA256 45e0d8ce355b8d32daad47354af4614373c31af9c14e633eccc4855de83f0bac
MD5 7f7f15b65ca3b5734614f87dcf8d3043
BLAKE2b-256 db446920d959a2f5be07f64c549ffaa7c34e1d129157126fb202d945cbadc96f

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