Skip to content

Version Control and Team Collaboration

It is 5pm on a Friday. You rebase your feature branch onto main for the deploy and hit a three-way conflict in the file two other people touched this week. The commit messages on both sides say “wip” and “fixes,” so you have no idea what intent each change carried. Twenty minutes later you are reading git blame line by line, the deploy window is closing, and a teammate’s PR has been sitting unreviewed for two days because nobody had time to read 600 lines of diff.

This is where AI-assisted version control earns its keep. Cursor reads diffs, branches, and PR history the same way it reads code, so it can draft the commit message, reason about both sides of a conflict, and review a PR before a human ever opens it. This guide covers the Cursor-specific workflows for commits, conflicts, reviews, and team-shared context — and the exact prompts that make them reliable.

  • A keyboard-driven flow for AI-generated commit messages that follow your team’s convention
  • A prompt for resolving merge conflicts that preserves intent from both branches
  • A .cursor/BUGBOT.md config that makes automated PR review catch your team’s specific mistakes
  • Shared .cursor/rules/ that keep everyone’s AI output consistent
  • The correct way to launch Cloud Agents from Slack (and what that integration does not do)

Never write another generic commit message. Cursor analyzes your staged changes and generates contextual, meaningful messages:

  1. Stage your changes in the Git panel
  2. Click the sparkle icon next to the commit message input
  3. Review and customize the generated message
  4. Commit with confidence

For faster commits, bind message generation to a shortcut:

// In Keyboard Shortcuts (Cmd/Ctrl+R then Cmd/Ctrl+S)
{
"key": "cmd+m",
"command": "cursor.generateGitCommitMessage"
}

Cursor 2.0 removed the @Git, @Branch, and @Recent Changes mentions. The agent now reads git state on its own when you ask in plain language — it runs git log, git diff, and git blame as tools. Skip the @ syntax and ask directly:

Review your branch

What have I changed in the auth module on this branch? Group the changes by intent.

Compare against main

Compare this branch with main and summarize the behavioral differences,
not just the line-level diff.

Inspect recent commits

Show what changed in my last three commits and flag anything that looks
unintentional or unrelated to the feature.

Fetch a PR

Fetch PR #123 from this repo and explain what it changes and why.

Checkpoints are automatic snapshots created when Agent makes changes to your code. They’re your instant undo button for AI modifications.

  • Automatic Creation: Every Agent action creates a checkpoint
  • Local Storage: Separate from Git, stored on your machine
  • Session-Based: Available for current and recent sessions
  • Agent-Only: Manual edits aren’t tracked

Two ways to restore:

Click Restore Checkpoint on any previous Agent request

When conflicts arise, let AI help resolve them intelligently:

  1. Encounter a merge conflict - Git markers appear in files
  2. Click “Resolve in Chat” in the merge conflict UI
  3. Agent analyzes both versions - Understanding intent from each branch
  4. Review proposed resolution - Agent suggests intelligent merge
  5. Apply or modify - Accept AI solution or request changes

The default “Resolve in Chat” prompt is fine for trivial conflicts, but for anything where both sides changed behavior, give the agent explicit instructions about what to preserve. Generic “merge these” prompts tend to pick one side and silently drop the other:

The “stop and ask” instruction matters: it is the difference between a merge you can trust and one where the agent quietly discarded a teammate’s change to make the conflict markers disappear.

With the GitHub MCP server connected, the agent can open the PR for you instead of you switching to the browser. The quality of the description depends entirely on how specific your prompt is — “make a PR” produces a restated diff; the prompt below produces something a reviewer can actually use:

Cursor indexes your repository’s pull requests, so the agent can mine historical decisions instead of you grepping closed PRs by hand. Ask in plain language and reference what you are looking for:

How have we implemented authentication in past PRs? List the relevant PR numbers
and summarize the approach each one took, then tell me which pattern is current.

The agent surfaces the matching PRs and can fetch the full diff of any one you name as a follow-up.

BugBot automatically reviews PRs for potential issues:

Bug Detection

Catches null checks, error handling, security issues

Code Standards

Enforces team conventions and best practices

Performance

Flags potential performance problems

Security

Identifies security vulnerabilities

Create .cursor/BUGBOT.md with team-specific rules:

# BugBot Configuration
## Critical Rules
- All API endpoints must have authentication
- No console.log statements in production code
- SQL queries must use parameterized statements
## Code Style
- Use async/await instead of promises
- Prefer const over let
- Destructure objects when possible
## Performance
- Warn about N+1 query patterns
- Flag synchronous file operations
- Check for missing database indexes

Teams can share indexing work for faster onboarding:

  • Automatic Sharing: Team members benefit from shared index
  • Faster Setup: New developers start with pre-built index
  • Consistent Context: Everyone has same codebase understanding

Models do not retain memory between completions, so durable architectural decisions belong in a version-controlled file the whole team shares — not in a chat the agent forgets. Cursor reads both .cursor/rules/ files and a project-root AGENTS.md at the start of the model context. For a quick, readable home for “facts everyone should know,” AGENTS.md is the lowest-friction option:

# Project Instructions
## Money handling
- All monetary values are stored as integer cents, never floats.
- Any code that touches prices, totals, or currency must use the Money
helper in src/lib/money.ts and never do raw floating-point math.
## Conventions
- Authentication uses JWT with a 15-minute access-token expiry.
- Pagination is cursor-based, not offset/limit.

Record decisions that are durable; leave one-off facts out so the file does not go stale. When a decision changes, edit the file and commit it so every teammate’s agent picks up the change.

Team-wide consistency through .cursor/rules/:

---
alwaysApply: true
---
- Use TypeScript for all new files
- Follow ESLint configuration
- Write tests for all new features
- Use semantic commit messages

When two unrelated features both need to ship, you do not have to serialize them. Cursor’s Cloud Agents run on isolated branches in the background, so you can dispatch one and keep working locally on the other. Launch them from the agent sidebar (or from Slack — see below) and each opens its own PR when done. Keep the tasks genuinely independent; two agents editing the same module will just hand you a merge conflict later.

A realistic review loop with Cursor in the mix looks like this:

  1. The author opens a PR with an AI-generated description (use the prompt above).
  2. BugBot reviews the diff automatically and comments inline on issues it finds.
  3. A human reviewer asks the agent to explain anything unclear before reading 600 lines by hand — for example, paste: Walk me through the authentication flow in this PR and flag any place a token could leak into logs.
  4. The author fixes review feedback in one pass with a prompt like: Address every BugBot comment on this PR. For each one, make the fix and reply with a one-line note on what you changed.
  5. Re-review, then merge.

This is the part most people get wrong. The Cursor Slack app is not a conversational bot that summarizes PRs or answers questions in-channel. Mentioning @Cursor spawns a Cloud Agent that works on a coding task in a repository and opens a PR — it picks the repo and model from your message and recent activity. Use it to kick off work without leaving Slack:

@Cursor in backend-api, fix the login bug where expired sessions return 200
@Cursor with opus, refactor the auth module to use the new token helper
@Cursor branch=develop autopr=false add rate limiting to the password reset endpoint
@Cursor list my agents

Use branch= to set the base branch and autopr=false if you do not want it to open a PR automatically. Run @Cursor settings to set a channel’s default repository, and @Cursor help for the current command list. There is no “summarize this PR for QA” command — for that, ask the agent inside the IDE using the PR-fetch prompt from earlier.

When a teammate needs docs, point the agent at the code rather than describing what you want:

The agent can drive git directly through its terminal tool, so these are pasteable prompts, not scripted output:

Create a feature branch off main called fix/cart-totals, cherry-pick commits
5abc123 and 7def456, then push it to origin and show me the resulting log.
Rebase this feature branch onto main. If you hit a conflict, keep my feature's
behavior, explain each resolution, and stop to ask if a resolution is ambiguous.

For repetitive checks, encode them in a git hook rather than re-prompting every time. A pre-commit hook that runs lint and type-check before each commit:

.git/hooks/pre-commit
#!/bin/bash
npm run lint
npm run type-check

Consistent Standards

Use shared rules and BugBot configuration

Knowledge Capture

Record durable decisions in shared rules and AGENTS.md

Regular Syncs

Share AI learnings in team meetings

Progressive Adoption

Start with volunteers, expand gradually

Track these metrics to measure improvement:

  • PR Turnaround Time: Should decrease with AI reviews
  • Merge Conflict Resolution: Faster with AI assistance
  • Code Consistency: Better with shared rules
  • Onboarding Speed: New devs productive faster
  • Bug Escape Rate: Lower with BugBot catching issues

You typed @Git or @Recent Changes out of habit and the agent ignored it. Those mentions were removed in Cursor 2.0. Drop the @ and ask in plain language (“compare this branch with main”) — the agent runs git itself.