Context-aware git CLI for multi-project research repos with worktree, squash, and fzf support.
Project description
🧠 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/mainvision/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 squashflow - 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 🧠
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file gitcontext-0.2.1.tar.gz.
File metadata
- Download URL: gitcontext-0.2.1.tar.gz
- Upload date:
- Size: 5.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
cc0cdf9a044b1e4c31ee7bb0fab0635ff75050f5d078f8610a23f838b503813f
|
|
| MD5 |
3a3e6e97612385b0dd1b1ecb0c173351
|
|
| BLAKE2b-256 |
2e8e62544f608b22e818973b1b5de52e0c030483b6705813cd6f2b34f1aaf7fb
|
File details
Details for the file gitcontext-0.2.1-py3-none-any.whl.
File metadata
- Download URL: gitcontext-0.2.1-py3-none-any.whl
- Upload date:
- Size: 4.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
59156c23ce389d5c0f2caae6428a812e1958997f769b6574d3bf457f23b264cb
|
|
| MD5 |
68a4a11ad4551e5838d1a140bc812e59
|
|
| BLAKE2b-256 |
0715c51f4fcfb7136c7128f19934bf06060d60012e9605ad6ee6e792e39c3a6d
|