2,507 Downloads Updated 2 weeks ago
Updated 2 weeks ago
2 weeks ago
9e07854fcc31 ยท 5.0GB
Turn diffs into clear, meaningful commit messages โ right from your terminal, powered by Ollama.
Two-step pipeline (separate models):
sp_change[_variant]
summarizes each changed file
sp_commit[_variant]
synthesizes the final commit message
Install the script globally with one line (default model = 8B):
sudo sh -c 'curl -L https://gist.githubusercontent.com/Tavernari/b88680e71c281cfcdd38f46bdb164fee/raw/c151c9e8dcfa834897dc1a06bd7d4a6fda9574c1/git-gen-commit \
-o /usr/local/bin/git-gen-commit && chmod +x /usr/local/bin/git-gen-commit'
You can also install the script with a predefined model variant. Choose one of the commands below:
sudo sh -c 'curl -sL "https://gist.githubusercontent.com/Tavernari/b88680e71c281cfcdd38f46bdb164fee/raw/c151c9e8dcfa834897dc1a06bd7d4a6fda9574c1/git-gen-commit" \
| sed -e "s/MODEL_VARIANT=\".*:-default.*/MODEL_VARIANT=\"default\"/" \
-e "s/--model)/--model-disabled)/" \
> /usr/local/bin/git-gen-commit && chmod +x /usr/local/bin/git-gen-commit'
sudo sh -c 'curl -sL "https://gist.githubusercontent.com/Tavernari/b88680e71c281cfcdd38f46bdb164fee/raw/c151c9e8dcfa834897dc1a06bd7d4a6fda9574c1/git-gen-commit" \
| sed -e "s/MODEL_VARIANT=\".*:-default.*/MODEL_VARIANT=\"mini\"/" \
-e "s/--model)/--model-disabled)/" \
> /usr/local/bin/git-gen-commit && chmod +x /usr/local/bin/git-gen-commit'
sudo sh -c 'curl -sL "https://gist.githubusercontent.com/Tavernari/b88680e71c281cfcdd38f46bdb164fee/raw/c151c9e8dcfa834897dc1a06bd7d4a6fda9574c1/git-gen-commit" \
| sed -e "s/MODEL_VARIANT=\".*:-default.*/MODEL_VARIANT=\"pro\"/" \
-e "s/--model)/--model-disabled)/" \
> /usr/local/bin/git-gen-commit && chmod +x /usr/local/bin/git-gen-commit'
Even after installation, you can still override the model:
GIT_GEN_COMMIT_MODEL=mini git-gen-commit
git-gen-commit --model default
git-gen-commit --model mini
git-gen-commit --model pro
--verbose
โ show the diff for each file during analysis--only-message
โ print only the final commit message (useful for scripting/CI)--update
โ pull the latest Ollama models (default
, mini
, pro
)--model <variant>
โ choose model (default
, mini
, pro
)--context <n>
โ set number of context lines for git diff
(default: 5)Examples:
# Get just the commit message, no UI
git gen-commit --only-message
# Use mini models and see the full diff
git gen-commit --model mini --verbose
# Update all models (default, nano, mini, pro)
git gen-commit --update
# Increase context lines
git gen-commit --context 10
Variant | Tags | Size | Context | Notes |
---|---|---|---|---|
Default | sp_change , sp_commit |
~8B | 256K | Balanced, general-purpose |
Mini | sp_change_mini , sp_commit_mini |
~4B | 128K | Fastest |
Pro | sp_change_pro , sp_commit_pro |
~14B | 256K | Most accurate, heavier |
Tip:
git gen-commit
Analyzes your staged diff and proposes a commit message. You can commit, edit, regenerate, or discard via an interactive menu.
With the script:
git gen-commit --update
Manually:
ollama pull tavernari/git-commit-message:sp_change
ollama pull tavernari/git-commit-message:sp_commit
ollama pull tavernari/git-commit-message:sp_change_mini
ollama pull tavernari/git-commit-message:sp_commit_mini
ollama pull tavernari/git-commit-message:sp_change_pro
ollama pull tavernari/git-commit-message:sp_commit_pro
Keep the project evolving with your support:
This is still an evolving tool. Always review the generated commit message before committing.
Submit diffs + commits (๐ / ๐) via this feedback form.
default
(8B), mini
(4B) and pro
(14B) models.--model <variant>
with default|mini|pro
.--context <n>
flag for diff granularity.sp_*
pipeline.