tavernari/
git-commit-message:sp_change_pro

2,507 2 weeks ago

Transform Git Commit Messages with AI: Chain of Draft, Reasoning, and Precision.

2 weeks ago

e83b1892b814 ยท 9.0GB

qwen3
ยท
14.8B
ยท
Q4_K_M
{{- if .System }}<|im_start|>system {{ .System }}<|im_end|> {{- end }} {{- range .Messages }}<|im_st
{ "num_ctx": 32768, "num_predict": 250, "stop": [ "<|im_start|>", "<|im_

Readme

Git Commit Message Generator

Turn diffs into clear, meaningful commit messages โ€“ right from your terminal, powered by Ollama.

Two-step pipeline (separate models):

  1. sp_change[_variant] summarizes each changed file
  2. sp_commit[_variant] synthesizes the final commit message

๐Ÿš€ Installation (macOS/Linux)

Made with VHS

Default installation

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'

Install with a specific model as default

You can also install the script with a predefined model variant. Choose one of the commands below:

  • Default (8B)
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'
  • Mini (4B)
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'
  • Pro (14B)
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'

Overriding the model at runtime

Even after installation, you can still override the model:

  • Using environment variable:
  GIT_GEN_COMMIT_MODEL=mini git-gen-commit
  • Using CLI flag:
  git-gen-commit --model default
  git-gen-commit --model mini
  git-gen-commit --model pro

โš™๏ธ Script Options

  • --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

๐Ÿง  Available Models

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:

  • Use mini for everyday development.
  • Use default/pro for large diffs and maximum accuracy.

Basic usage

git gen-commit

Analyzes your staged diff and proposes a commit message. You can commit, edit, regenerate, or discard via an interactive menu.


๐Ÿ”„ Updating Models

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

โ˜•๏ธ Support

Keep the project evolving with your support:

Buy me a coffee โ˜•๏ธ


โš ๏ธ Disclaimer

This is still an evolving tool. Always review the generated commit message before committing.


๐Ÿ“ฌ Feedback & Contact

Submit diffs + commits (๐Ÿ‘ / ๐Ÿ‘Ž) via this feedback form.


Release Notes (short)

  • Aug/2025: Added default (8B), mini (4B) and pro (14B) models.
  • Aug/2025: Script now supports --model <variant> with default|mini|pro.
  • Aug/2025: Added --context <n> flag for diff granularity.
  • Legacy: Older tags still exist, but recommended flow is sp_* pipeline.