@Git for Analysis
@Git What changes have I made in the auth module?
Version control and team collaboration are no longer just about managing code changes—they’re about leveraging AI to enhance every aspect of the development workflow. From generating meaningful commit messages to resolving complex merge conflicts, Cursor transforms how teams work together.
Never write another generic commit message. Cursor analyzes your staged changes and generates contextual, meaningful messages:
For faster commits, bind message generation to a shortcut:
// In Keyboard Shortcuts (Ctrl+K Ctrl+S){ "key": "cmd+m", "command": "cursor.generateGitCommitMessage"}
Use @Git
to bring version control information into your AI conversations:
@Git for Analysis
@Git What changes have I made in the auth module?
@Branch Comparison
@Branch Compare current branch with main
@Recent-changes
@Recent-changes Show what changed in the last hour
PR Context
@PR #123 Explain the changes in this PR
Checkpoints are automatic snapshots created when Agent makes changes to your code. They’re your instant undo button for AI modifications.
Two ways to restore:
Click Restore Checkpoint
on any previous Agent request
Hover over any Agent message and click the + button
When conflicts arise, let AI help resolve them intelligently:
<<<<<<< HEADfunction calculateTotal(items) { return items.reduce((sum, item) => sum + item.price, 0);}=======function calculateTotal(items, includeTax = true) { const subtotal = items.reduce((sum, item) => sum + item.cost, 0); return includeTax ? subtotal * 1.08 : subtotal;}>>>>>>> feature/tax-calculation
Agent: I see both branches made improvements. HEAD renamed to 'price'while feature branch added tax calculation using 'cost'. Let me mergethese intelligently:
function calculateTotal(items, includeTax = true) { const subtotal = items.reduce((sum, item) => sum + item.price, 0); return includeTax ? subtotal * 1.08 : subtotal;}
This keeps the 'price' naming from HEAD and the tax feature fromthe feature branch.
When using GitHub/GitLab MCP integration:
Agent: Create a pull request for this feature with:- Detailed description of changes- Links to related issues- Test coverage information
Agent will:
Cursor indexes all merged PRs, making historical knowledge searchable:
Ask: How have we implemented authentication in past PRs?
Agent searches PR history and finds:- PR #45: "Add JWT authentication"- PR #89: "Implement OAuth2 flow"- PR #123: "Add two-factor authentication"
[Agent provides summaries and can fetch full PR details]
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:
Memories capture important project decisions and context:
Developer A: Discusses authentication architecture with CursorCursor: Creates memory "Auth uses JWT with 15-minute expiry"
Developer B: Later asks about auth implementationCursor: References the memory and provides consistent answer
Team-wide consistency through .cursor/rules/
:
- Use TypeScript for all new files- Follow ESLint configuration- Write tests for all new features- Use semantic commit messages
- All endpoints return consistent error format- Use middleware for authentication- Validate input with Joi schemas- Return 201 for successful creation
- Unit test coverage minimum 80%- Integration tests for all API endpoints- E2E tests for critical user flows- Mock external services in tests
Working on multiple features simultaneously:
# Terminal 1 - Feature AAgent: Create a new branch for user profile feature[Agent creates branch, starts development]
# Terminal 2 - Feature BAgent: In a new branch, implement notification system[Agent works independently]
# Later - IntegrationAgent: Help me merge both features and resolve any conflicts
Reviewer: @Code Explain the authentication flow in this PR
Agent: Fix the issues BugBot identified in PR #234
In Slack:@Cursor summarize PR #456 for the QA team
Cursor responds:This PR adds password reset functionality:- Users can request reset via email- Tokens expire after 1 hour- Includes rate limiting (3 attempts/hour)- Full test coverage added
Agent: Generate API documentation from our codebase forthe frontend team. Include examples and authentication requirements.
If using Git MCP server:
Agent: Create a new feature branch, cherry-pick commits5abc123 and 7def456 from main, then push to origin
Agent: Help me rebase this feature branch on main.Resolve any conflicts keeping our feature changes.
Pre-commit hook example:
#!/bin/bash# Run linting and type checking before committingnpm run lintnpm run type-check
Consistent Standards
Use shared rules and BugBot configuration
Knowledge Capture
Approve helpful memories for team benefit
Regular Syncs
Share AI learnings in team meetings
Progressive Adoption
Start with volunteers, expand gradually
Track these metrics to measure improvement:
Issue: Team member's Cursor re-indexing from scratch
Solution:1. Check team settings in Cursor2. Ensure "Share codebase index" is enabled3. Verify team member has proper permissions
Issue: BugBot not catching obvious problems
Solution:1. Review .cursor/BUGBOT.md configuration2. Add specific rules for your patterns3. Check BugBot is enabled in settings
Issue: Team can't see each other's memories
Solution:1. Ensure using same project workspace2. Check memory sharing settings3. Manually approve memories for sharing
Transform your team’s collaboration: