2,648 1 month ago

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

1 month ago

b92bf9090182 · 5.0GB ·

qwen3
·
8.19B
·
Q4_K_M
{{- if .System }}<|im_start|>system {{ .System }}<|im_end|> {{- end }} {{- range .Messages }}<|im_st
{ "num_ctx": 128000, "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

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.


🚀 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/bbcbf9909054ad0cf99a4c17e8d72e4e1666d6ae/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/bbcbf9909054ad0cf99a4c17e8d72e4e1666d6ae/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/bbcbf9909054ad0cf99a4c17e8d72e4e1666d6ae/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/bbcbf9909054ad0cf99a4c17e8d72e4e1666d6ae/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 40k Balanced, general-purpose
Mini sp_change_mini, sp_commit_mini ~4B 256k Fastest
Pro sp_change_pro, sp_commit_pro ~14B 40k Most accurate, heavier

Tip:

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

🔄 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. 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/bbcbf9909054ad0cf99a4c17e8d72e4e1666d6ae/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/bbcbf9909054ad0cf99a4c17e8d72e4e1666d6ae/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/bbcbf9909054ad0cf99a4c17e8d72e4e1666d6ae/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/bbcbf9909054ad0cf99a4c17e8d72e4e1666d6ae/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 40k Balanced, general-purpose
Mini sp_change_mini, sp_commit_mini ~4B 256k Fastest
Pro sp_change_pro, sp_commit_pro ~14B 40k Most accurate, heavier

Tip:

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

🔄 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.