gg ask
AI AssistantAsk GitGuru anything in natural language and get smart Git command suggestions with safety analysis.
Usage
gg ask "<query>" [options]Description
The gg ask command is your AI-powered Git assistant. Simply ask what you want to do in natural language, and GitGuru will analyze your question, understand your intent, and suggest the appropriate Git command. Each suggestion includes:
- The exact Git command to run
- A clear explanation of what the command does
- A safety level indicator (Safe, Caution, or Dangerous)
- An interactive prompt before execution
Options
| Option | Description |
|---|---|
| -y, --yes | Skip confirmation and execute the command immediately |
| -h, --help | Display help information for this command |
Examples
Undo Last Commit
gg ask "undo last commit but keep changes"GitGuru suggests: git reset --soft HEAD~1 (Safety: Caution)
Create and Switch Branch
gg ask "create a new branch called feature-login"GitGuru suggests: git checkout -b feature-login (Safety: Safe)
Save Work Temporarily
gg ask "save my changes without committing"GitGuru suggests: git stash push -m "WIP" (Safety: Safe)
Revert Changes
gg ask "undo changes to a specific file"GitGuru asks for the filename and suggests: git restore <file> (Safety: Caution)
Skip Confirmation
gg ask "show git log" --yesExecutes immediately without prompting for confirmation.
Safety Levels
GitGuru analyzes every suggested command and assigns a safety level:
Safe
Read-only operations with no risk of data loss
Example: git status, git log
Caution
Modifies working directory but can be reversed
Example: git reset --soft, git stash
Dangerous
Can permanently delete data or rewrite history
Example: git reset --hard, git push --force
Common Use Cases
- Undo operations: "undo last commit", "discard all changes"
- Branch management: "switch to main branch", "delete remote branch"
- Stashing: "save my work temporarily", "apply last stash"
- History viewing: "show recent commits", "see file history"
- Cleanup tasks: "remove untracked files", "prune remote branches"
- Merging and rebasing: "merge develop into current branch", "rebase on main"
Tips
- Be specific in your questions for better suggestions
- You can ask follow-up questions to refine the suggestion
- Use
--yesflag only for safe, read-only operations - Always read the explanation before confirming dangerous operations