Command Palette

Search for a command to run...

UnylyUnyly
Back to skills

cursor-git-integration

FreeNo executable scriptsNot checked

Integrate Git workflows with Cursor IDE: AI commit messages, @Git context, diff review, and conflict resolution. Triggers on "cursor git", "git in cursor"…

jeremylongshoreby jeremylongshore★ 2,961 GitHub stars

About this skill

Cursor Git Integration

Overview

Use Cursor's Git features as a view and drafting aid while preserving repository branch protection, reviews, signed checks, and human ownership of commits/merges.

Prerequisites

  • A clean or recoverable working tree, repository contribution rules, and correct remote identity.
  • Required checks and reviewer/approval expectations for the target branch.

Instructions

  1. Inspect status and diff before staging; stage only reviewed, intended files.
  2. Draft but verify commit messages and never include secrets or unrelated changes.
  3. Run required local checks, push through the normal branch/PR workflow, and resolve feedback with evidence.
  4. Use revert or a new corrective commit for mistakes rather than rewriting shared history.

Output

  • A scoped, reviewable Git change with validation evidence and a normal revert path.

Error Handling

Condition Safe response
Working tree has unrelated changes Separate/stash them before staging.
Generated commit message misstates work Edit it to match the actual diff.
Protected branch rejects push Use the approved PR/check process; do not weaken controls.

Examples

Review a Cursor-generated diff, stage only its intended files, run the focused suite, and push a topic branch for review. If an accidental file is staged, unstage it and recheck the diff before committing.

Leverage Cursor's AI features within Git workflows: AI-generated commit messages, @Git context for code review, merge conflict resolution, and branch management.

Source Control Panel

Access with Cmd+Shift+G / Ctrl+Shift+G:

┌─ SOURCE CONTROL ────────────────────────────────┐
│  main ← current branch                         │
│                                                 │
│  Changes (3)                                    │
│    M  src/api/users.ts                         │
│    A  src/api/products.ts                      │
│    M  prisma/schema.prisma                     │
│                                                 │
│  Commit message: [✨ Generate with AI]          │
│  [Commit]  [Commit & Push]                      │
└─────────────────────────────────────────────────┘

AI-Generated Commit Messages

Click the sparkle/AI icon next to the commit message input. Cursor reads the staged diff and generates a message:

Example output:

feat: add product catalog CRUD API with Prisma model

- Add Product model to Prisma schema with name, price, category fields
- Create GET/POST/PUT/DELETE endpoints in src/api/products.ts
- Add Zod validation for product creation and update inputs

Tips for better commit messages:

  • Stage related changes together (not unrelated edits)
  • The AI reads the diff, so clean diffs produce better messages
  • Edit the generated message before committing if needed
  • Configure Conventional Commits in project rules:
# .cursor/rules/git-conventions.mdc
---
description: "Git commit conventions"
globs: ""
alwaysApply: true
---
Use Conventional Commits format:
- feat: new feature
- fix: bug fix
- refactor: code restructure without behavior change
- docs: documentation only
- test: adding or updating tests
- chore: maintenance tasks

Keep subject line under 72 characters.
Body explains WHY, not WHAT (the diff shows what).

@Git Context in Chat

Use @Git in Chat or Composer to include git context:

@Git (Working State)

@Git

Review my uncommitted changes. Check for:
- Any debugging code left in (console.log, debugger)
- Missing error handling
- Type safety issues
- Potential performance problems

@Git includes the diff of all uncommitted changes (staged + unstaged).

@Git (Branch Diff)

@Git

Summarize all changes in this branch compared to main.
What features/fixes were implemented?
Are there any breaking changes?

When on a feature branch, @Git shows the cumulative diff between your branch and main.

Merge Conflict Resolution

When a merge conflict occurs, use Chat for AI assistance:

@src/api/users.ts

I have a merge conflict in this file. The markers show:
<<<<<<< HEAD (my changes)
  Added email validation with Zod
=======
  Added phone number field to user schema
>>>>>>> feature/phone-support

Help me resolve this to keep both changes:
- Keep the Zod email validation from my branch
- Add the phone number field from the other branch
- Ensure the Zod schema includes phone validation too

Systematic Conflict Resolution Workflow

# 1. Start the merge
git merge feature/other-branch

# 2. List conflicted files
git diff --name-only --diff-filter=U

# 3. For each conflicted file, open in Cursor and use Chat:
#    @the-conflicted-file.ts
#    "Resolve the merge conflict. Keep both sets of changes where possible."

# 4. After resolving, stage and commit
git add .
git commit -m "merge: resolve conflicts between feature branches"

Code Review with AI

Reviewing a PR Before Pushing

@Git

I'm ab
Full SKILL.md on GitHub

Install cursor-git-integration in Claude Code & Claude Desktop

Sign up to install this skill

Create a free account to reveal the install command and save the skill to your library.

  • Reveal the one-line install command
  • Save skills to your synced library
  • Get notified when skills update
Sign up freeI already have an account

Allowed tools

Tools this skill is permitted to call.

Read
Write
Edit
Bash(cmd:*)

Bundled files

references/advanced-git-operations.mdreferences/ai-powered-git-workflows.mdreferences/best-practices.mdreferences/errors.mdreferences/examples.mdreferences/git-commands-via-terminal.mdreferences/git-hooks-integration.mdreferences/viewing-history.md

FAQ

What does the cursor-git-integration skill do?

Integrate Git workflows with Cursor IDE: AI commit messages, @Git context, diff review, and conflict resolution. Triggers on "cursor git", "git in cursor", "cursor version control", "cursor commit", "cursor branch", "@Git".

How do I install the cursor-git-integration skill?

Copy the skill folder into ~/.claude/skills (the Claude Code tab above does this in one command), or install it as a plugin.

Does the cursor-git-integration skill run scripts?

No, this skill is instructions only (SKILL.md) with no executable scripts.

Related skills

Compare cursor-git-integration with