@git-changes
or specific commits with @[commit-hash]
.
When you type @
in chat, you can select “Git Changes” from the menu or type @git-changes
directly. For specific commits, type @
followed by the commit hash (at least 7 characters). Cline will immediately see the git status, diffs, commit messages, and other relevant information.
I use git mentions constantly when I’m trying to understand code changes or troubleshoot issues introduced by recent commits. Instead of trying to copy and paste diffs or commit logs, I just ask:
@git-changes
mention is perfect when you’re working on changes and want feedback before committing:
How It Works Under the Hood
When you use git mentions in your message, here’s what happens behind the scenes:For Git Changes (@git-changes
)
-
When you send your message, Cline detects the
@git-changes
pattern in your text - The extension runs git commands to get the current working state of your repository
-
It captures the output of
git status
andgit diff
to see all uncommitted changes -
This information is appended to your message in a structured format:
For Specific Commits (@[commit-hash]
)
-
When you send your message, Cline detects the
@
followed by a commit hash pattern -
The extension runs
git show
and related commands to get information about that commit - It retrieves the commit message, author, date, and the complete diff
-
This information is appended to your message in a structured format: