Thank you for your interest in contributing to gitgrip! This document provides guidelines for contributing.
- Rust toolchain (rustc, cargo) — MSRV 1.80
- Git
# Clone the repository
git clone git@github.com:synapt-dev/grip.git
cd grip
# Build the project
cargo build
# Run tests
cargo testAlways create a new branch for your changes. Never work directly on main.
# Ensure you're on latest main
git checkout main
git pull origin main
# Create your feature branch
git checkout -b feat/your-feature-name
# or
git checkout -b fix/your-bugfix-name
# or
git checkout -b docs/your-docs-change-nameMake your changes to the codebase. Follow Rust conventions:
- Use
cargo clippyto check for linting issues - Use
cargo fmtto format code - Add tests for new functionality
- Update documentation as needed
Write descriptive commit messages following conventional commits:
# Format your code first
cargo fmt
# Run linting
cargo clippy
# Stage and commit
git add <files>
git commit -m "feat: add new command for xyz"
# Or for fixes:
git commit -m "fix: resolve issue with xyz"
# Or for documentation:
git commit -m "docs: improve readme section"git push origin feat/your-feature-name
gh pr create --title "feat: your feature description" --body "..."- Wait for CI checks to pass
- Address any review feedback
- Don't merge until all checks pass
Once approved and CI passes, merge the PR via GitHub's interface.
- Clear title describing the change
- Detailed description of the problem and solution
- Steps to test the changes
- Screenshots or GIFs for UI changes
- References to related issues
- Run
cargo testbefore pushing - Add unit tests for new functionality
- Integration tests for user-facing commands
- Run
cargo fmtbefore committing - Fix any
cargo clippywarnings - Document public APIs with doc comments
Main Branch (main)
- Production-ready code only
- Protected with PR requirements and CI checks
- All PRs must target
main - Never force push to
main❌
Feature Branches
- All development happens here
- Short-lived, deleted after merge
- Clean merge history when merged properly
✅ Use REBASE (correct):
git rebase origin/main # Keeps history linear
git push --force-with-lease # Safe force-push after rebase (feature branches only!)❌ DO NOT Use MERGE (incorrect):
git merge origin/main # Creates unnecessary merge commits❌ DO NOT Force Push to Main (NEVER!):
git push --force origin main # ABSOLUTELY FORBIDDEN- Destroys history: Rewrites shared history, breaking anyone who pulled
- Lose work: Others' commits may be erased
- Breaks CI/CD: GitHub Actions and deploys may fail
- Trust issues: Team members can't trust what they pulled
- Create feature branch from latest main
- Make changes and commit
- Push branch and create PR
- Get reviewed and approved
- Merge via GitHub button
- Delete feature branch
- Stop immediately - Don't do anything else
- Contact team - Alert everyone who might have pulled
- Restore from backup - Use reflog or team members' clones
- Redo properly - Cherry-pick commits to a new branch and create proper PR
This project follows the Contributor Covenant.
Open an issue for discussion or reach out to the maintainers.
This section applies when using gitgrip to manage the workspace itself.
When working with the gitgrip workspace:
# Make changes in the tooling repo (where gitgrip source lives)
cd tooling/src/cli/commands/repo.rs
# ... edit file ...
# Stage and commit (runs gr commit across all workspaces)
git add .
git commit -m "fix: ..."
# Push (runs gr push across all workspaces)
git push- Make changes to gitgrip code in the
toolingrepo - The commit/push operations automatically apply to all workspace repos
- When creating a PR, only ONE GitHub PR is needed (for the tooling repo)
- GitHub Actions and CI run from the tooling repo
- Merging the PR updates only the tooling repo's history
The PR for gitgrip changes should be created from the tooling repo's perspective:
gh pr create # From the tooling directoryThis creates the PR for github.com/synapt-dev/grip, not the workspace manifest.
- CLAUDE.md - Development guide and command reference
- README.md - User-facing documentation
- CONTRIBUTING.md - This file
- CHANGELOG.md - Version history
- docs/SKILL.md - AI assistant skill definition
- docs/MANIFEST.md - Manifest reference
- .claude/skills/gitgrip/SKILL.md - Claude Code skill integration
If you see an error like:
fatal: 'main' is already used by worktree at '...'
This happens when gitgrip has multiple worktrees (e.g., in codi-workspace and codi-dev).
To resolve:
-
Create a new branch instead of checking out main:
git checkout -b fix/my-feature gr branch fix/my-feature
-
Or use the existing worktree at codi-workspace for gitgrip-related work
Prevention:
- Keep main checked out in one workspace (codi-workspace recommended)
- Use other workspaces for feature branches
- Or use
gr branchwhich handles this automatically