# Git Assistant for Raycast

URL: https://www.raycast.com/validate/git-assistant

> Search Git repositories on your computer and use Raycast AI to write conventional commit messages, commit, branch, diff, push and pull.

- Install: raycast://extensions/validate/git-assistant
- Author: [Mert Can Demir](https://www.raycast.com/validate)
- Installs: 2,322
- Platforms: macOS
- Categories: Developer Tools, AI Extensions
- Updated: 2026-11-20
- Source: https://github.com/raycast/extensions/tree/e38232e713cc42a58cac81b8d3af9261fd1624e5/extensions/git-assistant/

## Commands

- **Search Git Repositories**: Search for git repositories on your computer by name

## AI tools

- **Get Current Directory**: Gets the specified directory and checks if it's a git repository. Must be called first before other git operations.
- **Get Current Branch**: Returns the current branch name for the repository.
- **Get Git Changes**: Gets all types of changes in a git repository including staged, unstaged, and untracked files.
- **Create Git Commit**: Creates a git commit with the provided message, optionally staging all changes first. Use after reviewing the suggested commit message.
- **Run Git Command**: Runs a git command directly without any analysis or commit. Use when user wants to run a git command directly.
- **Get Git Status Summary**: Returns a summarized view of the repository status including branch, ahead/behind and changed files.
- **Get Git Log**: Returns recent commits for the repository with metadata suitable for summaries and explanations.
- **Get Git Branches**: Lists local and optionally remote branches for the repository.
- **Create Branch**: Creates a new branch in the repository, optionally based on another branch.
- **Checkout Branch**: Switches the current repository to another branch.
- **Stage Files**: Stages specific files in the repository for commit.
- **Unstage Files**: Unstages specific files in the repository while keeping their changes.
- **Get Git Diff Unstaged**: Shows the unstaged diff for the working directory with configurable context lines.
- **Get Git Diff Staged**: Shows the staged diff for the working directory with configurable context lines.
- **Get Git Diff Target**: Shows the diff between the current state and a target branch or revision.
- **Show Commit**: Shows the details and patch for a specific commit revision.
- **Reset Staged Changes**: Unstages all staged changes in the repository while keeping modifications in the working tree.
- **Revert Commit**: Reverts a specific commit, optionally without creating a revert commit immediately.
- **Push Current Branch**: Pushes the current branch to its remote with safe defaults and confirmation.
- **Pull Current Branch**: Pulls the latest changes for the current branch from its remote using fast-forward only by default.
- **Clone Repository**: Clones a git repository to a specified target directory. Extracts the repository name from the URL and clones to targetDirectory/repoName. Does not require the target directory to be a git repository.

## README

### Git Assistant

A Raycast extension that enhances your Git workflow with AI-powered features and convenient tools.

#### Features

##### 🔍 Search Git Repositories
- Search and navigate through your Git repositories quickly
- View repository status and recent changes

##### 🤖 AI-Powered Commit Messages
- Analyze your changes and generate meaningful conventional commit messages
- Support for both staged and unstaged changes
- Follows the Conventional Commits specification
- Options to include/exclude scope and description

##### 🛠️ Git Operations
- Create commits with AI-suggested messages
- Stage all changes or work with already staged changes
- Execute custom git commands with repository context

#### Tools

The extension includes several specialized tools:

- `get-current-directory`: Detects the current working directory and Git repository status
- `get-git-changes`: Retrieves detailed information about repository changes (staged, unstaged, and untracked)
- `commit-changes`: Creates Git commits with proper confirmation
- `run-git-command`: Executes Git commands in the repository context
- `get-current-branch`: Retrieves the name of the current Git branch
- `get-git-branches`: Lists local and remote branches with optional filtering
- `create-branch`: Creates a new branch, optionally based on another branch, and switches to it
- `checkout-branch`: Switches to an existing branch using `git switch` with safe name escaping
- `get-git-status-summary`: Shows a concise repository status, including branch tracking and file state summary
- `get-git-log`: Retrieves commit history with optional limits and date filtering
- `show-commit`: Displays detailed information and patch for a specific commit
- `revert-commit`: Reverts a specific commit, with support for staging changes without committing
- `get-git-diff-staged`: Shows diffs for staged changes
- `get-git-diff-unstaged`: Shows diffs for unstaged changes
- `get-git-diff-target`: Compares the current state against a target branch or revision with configurable context
- `stage-files`: Adds specific files to the Git index
- `unstage-files`: Removes specific files from the Git index without discarding working tree changes
- `reset-staged`: Unstages all currently staged changes in the repository
- `pull-current-branch`: Updates the current branch from its remote, using fast-forward only by default
- `push-current-branch`: Pushes the current branch to its remote and configures upstream when needed

#### Usage

1. **Search Repositories**
   - Use the "Search Git Repositories" command to find and navigate your repositories

2. **Create AI-Powered Commits**
   - Stage your changes using Git
   - Use the extension to analyze changes and generate a commit message
   - Review and confirm the commit

3. **Custom Git Commands**
   - Execute any Git command directly through the extension
   - Maintains proper repository context

#### Contributing

Feel free to open issues or submit pull requests to improve the extension.
