A streamlined Git review workflow tool for Gitea and GitLab, inspired by Gerrit's git-review.
git-nearit simplifies the pull request workflow by automating branch creation, pushing, and PR management. Instead of manually creating branches, pushing with the right flags, and navigating to your Git hosting UI, you can submit reviews with a single command.
Key features:
- One-command review submission
- Download and checkout pull requests locally
- List active reviews for a repository
Traditional workflow:
git checkout -b feature/my-change
# ... make changes ...
git add .
git commit -m "fix: improve performance"
git push -u origin feature/my-change
# Navigate to Gitea/GitLab UI
# Click "New Pull Request"
# Fill in title and descriptionWith git-nearit:
git add .
# yes, on the main branch! Or the branch you want to submit to
git commit -m "fix: improve performance"
git tea-review
# That's it! Branch created, pushed, and PR opened- Python 3.11 or higher
- Git
- uv (recommended) or pip
git clone https://github.com/yourusername/git-nearit.git
cd git-nearit
uv sync # or: pip install -e .Configure your Gitea access token:
# Store token directly
git config nearit.gitea.git.example.com.token YOUR_TOKEN
# Or use environment variable (more secure)
git config nearit.gitea.git.example.com.token env(GITEA_TOKEN)
export GITEA_TOKEN="your-token-here"Obtaining a token:
- Go to your Gitea instance → Settings → Applications
- Generate a new token with
repopermissions - Copy and configure as shown above
# Store token directly
git config nearit.gitlab.gitlab.com.token YOUR_TOKEN
# Or use environment variable
git config nearit.gitlab.gitlab.com.token env(GITLAB_TOKEN)
export GITLAB_TOKEN="your-token-here"Obtaining a token:
- Go to GitLab → Preferences → Access Tokens
- Create a token with
apiscope - Copy and configure as shown above
If your Gitea/GitLab instance uses a custom URL:
git config nearit.gitea.git.example.com.url https://git.example.com:8443For Gitea:
# From any branch (creates timestamped change branch if needed)
git tea-review
# Target a specific branch
git tea-review developFor GitLab:
git lab-review
# Target a specific branch
git lab-review developCreates timestamped change/YYYYMMDDHHmmss branches when submitting from main, prompts for title/description, and opens the PR automatically.
git tea-review -d 42 # Gitea
git lab-review -d 42 # GitLabgit tea-review -l # List reviews for main branch
git tea-review -l develop # List for specific branchgit clone https://github.com/yourusername/git-nearit.git
cd git-nearit
uv sync --all-extras
uv run pytest -xvs- "No token found": Configure token for your hostname:
git config nearit.gitea.YOUR_HOSTNAME.token YOUR_TOKEN - "Uncommitted changes": Commit or stash tracked file changes (untracked files are fine)
- "Not a git repository": Run from inside a git repository
- Gitea support
- Download PR for review/edit (
-dflag) - Complete GitLab client implementation
- GitHub support
- Interactive rebase workflow
- Draft PR support
MIT
Contributions welcome! Please:
- Fork the repository
- Create a feature branch
- Add tests for new functionality
- Ensure all tests pass
- Submit a pull request
Inspired by git-review from the OpenStack project.