Skip to main content

🧠 gitx (gitx with -k for context)

A context-aware Git CLI wrapper for multi-project repositories. Use gitx -k ... to activate!


💡 Why gitx -k?

In large research or dev repos, you often juggle multiple projects and subprojects. That makes your Git workflow chaotic:

  • Unstructured branch names
  • No clarity which branch belongs to which subproject
  • Tedious checkouts and pushes

gitx introduces a context system using a project.context file. It wraps normal Git commands to:

  • ✅ Automatically prefix branch names with project/subproject
  • 🔍 Let you fuzzy-pick branches with fzf
  • 🌳 Work smoothly inside worktrees
  • 💥 Bypass with regular Git anytime

🚀 How It Works

You just add -k (or --ctx) to any gitx command to enable the context mode:

gitx -k checkout mybranch     # Resolves to: project/subproject/mybranch
gitx -k push                  # Pushes current context-prefixed branch
gitx -k branch                # Lists branches in current context

To fallback to normal git:

gitx status                   # Regular Git
gitx -k status                # Also regular Git (noop)

📂 Setup

🔁 Install in Dev Mode

git clone https://github.com/ax-or/gitcontext
cd gitcontext
python -m venv venv
source venv/bin/activate
pip install -e ".[dev]"

Then, gitx is ready to use. You can further make your git to point to gitx

alias git=gitx

📄 project.context Format

At the root of your repo, define the context:

[context]
project = vision
subproject = segmentation

If no subproject:

[context]
project = vision

Your branch names will automatically be prefixed:

  • vision/main
  • vision/segmentation/feature-x

⚙️ Supported Commands

gitx -k checkout feature/xyz        # Checkout branch in context
gitx -k checkout --pick             # Fuzzy pick
gitx -k create new-feature          # Create context branch
gitx -k push --force-with-lease     # Push current branch
gitx -k branch                      # List context branches
gitx -k fetch                       # Fetch remote branches under context

🔍 Requirements

  • Python 3.8+
  • fzf (for interactive mode)

🔬 Testing

pytest tests/

🧪 Future Features

  • Commit squashing with autosquash
  • gitx -k squash flow
  • GitHub PR integration
  • gitx -k worktree add
  • Cross-context dashboard

📜 License

MIT © AxOr


⭐️ Contribute

If you find this useful:

  • Star the repo ⭐️
  • Share it
  • File issues and ideas 🧠

Metadata

Release files for gitcontext 0.2.1

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

Source distribution (sdist)

Source distribution for gitcontext 0.2.1
File Size Uploaded Provenance
gitcontext-0.2.1.tar.gz 5.0 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for gitcontext 0.2.1
File Interpreter ABI Platform
gitcontext-0.2.1-py3-none-any.whl Python 3 none any Details

Total release size: 9.5 kB

Release files / gitcontext-0.2.1.tar.gz

Download URL gitcontext-0.2.1.tar.gz
Size 5.0 kB
Tags Source
SHA-256 checksum
How to use checksums
cc0cdf9a044b1e4c31ee7bb0fab0635ff75050f5d078f8610a23f838b503813f
BLAKE2b-256 checksum
How to use checksums
2e8e62544f608b22e818973b1b5de52e0c030483b6705813cd6f2b34f1aaf7fb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.6

Release files / gitcontext-0.2.1-py3-none-any.whl

Download URL gitcontext-0.2.1-py3-none-any.whl
Size 4.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
59156c23ce389d5c0f2caae6428a812e1958997f769b6574d3bf457f23b264cb
BLAKE2b-256 checksum
How to use checksums
0715c51f4fcfb7136c7128f19934bf06060d60012e9605ad6ee6e792e39c3a6d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.1.0 CPython/3.9.6

Security for gitcontext 0.2.1

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.

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files No provenance

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