Skip to main content

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
gpr track git@gitlab.com:user/repo.git --name repo-gl   # same repo name, second foundry

# Clone missing repos, pull & push existing ones
gpr sync
gpr sync my-repo      # one project

# Stop tracking
gpr untrack my-repo        # keeps the local clone
gpr untrack my-repo --rm   # deletes the clone if all its content is on a remote
gpr untrack my-repo --rm -f   # deletes the clone without checks

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> [--name] [--path] Clone a project and add it to tracking
untrack <name> [--rm [-f]] Remove a project from tracking; --rm also deletes the clone
sync [name] [--workers N] Clone missing repos, pull & push existing tracked repos
info Show version, paths, and repo counts

Notes:

  • track clones first. A failed clone leaves nothing tracked.
  • track adopts an existing directory only if its origin URL equals the clone URL.
  • untrack --rm refuses to delete a clone with uncommitted files, unpushed commits, or git-ignored files such as .env. -f skips these checks.
  • sync skips repos with uncommitted changes and returns exit code 1 if a project fails.

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

Metadata

Release files for git-proj 0.8.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for git-proj 0.8.0
File Size Uploaded Provenance Actions
git_proj-0.8.0.tar.gz 13.3 kB Without provenance Details for git_proj-0.8.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for git-proj 0.8.0
File Interpreter ABI Platform Actions
git_proj-0.8.0-py3-none-any.whl Python 3 none any Details for git_proj-0.8.0-py3-none-any.whl

Total release size: 32.4 kB

Release files / git_proj-0.8.0.tar.gz

Download URL git_proj-0.8.0.tar.gz
Size 13.3 kB
Tags Source
SHA-256 checksum
How to use checksums
b5c3723f086d859dbac022d56bd1f42716fd70d58a33fd030cd9856b3f8f4b7d
BLAKE2b-256 checksum
How to use checksums
c17f2d79f00d90980725a22edfde1c66b4503c29399f8df0fec96e137682ee3a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.8

Release files / git_proj-0.8.0-py3-none-any.whl

Download URL git_proj-0.8.0-py3-none-any.whl
Size 19.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
594313af0b8d5ddc6d13ce5dd83fdd146b89951e557b0a5c9e76a143379bea6c
BLAKE2b-256 checksum
How to use checksums
ab1bd802a7148fba22e69bff1372d9981b0a69224b1c770898b02823410e8a1c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.8.8

Security for git-proj 0.8.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page