A powerful Rust-based CLI tool that streamlines your Git workflow by automating commit message generation and branch management.
- 📝 Automated Commit Message Generation - Creates structured commit messages with file-by-file descriptions
- 🌳 Smart Branch Management - Easy branch switching with stash handling
- 🎯 Selective File Inclusion - Support for
.commitignore
to exclude specific files from commit messages - 🚀 Git Operations - Simplified commit and push operations
- 🎨 Interactive UI - Beautiful terminal interface with colored prompts
-
Clone the repository:
git clone https://github.com/yourusername/git-commit-rust.git cd git-commit-rust
-
Build the project:
cargo build --release
-
Add to your PATH or create an alias:
# In your shell config file (.bashrc, .zshrc, config.fish, etc.) alias gcommit="/path/to/git-commit-rust/target/release/git_commit_with_rust"
gcommit -g
This will:
- Create a
commit_message.md
file - Scan for modified/added files
- Generate a structured template
- Open the file in your editor
gcommit -c # Commit only
gcommit -cp # Commit and push
gcommit -cpa --set-upstream origin main # Commit and push with args
gcommit -s # Switch branches
gcommit -s --stash # Stash changes before switching
gcommit -s --apply-stash # Apply stash after switching
[commit_nb] (<type> on <branch>) TL;DR Brief description
- `file1.rs`:
Description of changes in file1
- `file2.rs`:
Description of changes in file2
Where type
can be:
feat
: New featuresfix
: Bug fixestest
: Test-related changeschore
: Maintenance tasks
Similar to .gitignore
, you can create a .commitignore
file to exclude files from appearing in the commit message template:
# Exclude documentation
*.md
docs/
# Exclude specific folders
target/
tests/
Command | Description |
---|---|
-g, --generate |
Generate commit message template |
-c, --commit |
Commit changes using template |
-p, --push |
Push changes to remote |
-s, --switch |
Interactive branch switching |
-a, --add-exclude |
Add files with exclusions |
This project is licensed under the MIT License - see the LICENSE file for details.