How to Remove Cursor’s Co-authored-by from Git Commits
Cursor automatically adds `Co-authored-by: Cursor [email protected]` to every commit message. You can only disable this in the IDE, but there’s no setting to disable this in the CLI, in Cursor cloud agents, or when using the “Generate git commit message” button.
You can remove it with a Git hook:
## Solution
Create a `prepare-commit-msg` hook that strips the line:
```bash
cat > .git/hooks/prepare-commit-msg << ‘EOF’
#!/bin/bash
sed -i ‘’ ‘/cursoragent@cursor\.com/d’ “$1”
EOF
chmod +x .git/hooks/prepare-commit-msg
```
**Note:** This uses macOS `sed` syntax. For Linux, use `sed -i` instead of `sed -i ‘’`.
## Linux Version
```bash
cat > .git/hooks/prepare-commit-msg << ‘EOF’
#!/bin/bash
sed -i ‘/cursoragent@cursor\.com/d’ “$1”
EOF
chmod +x .git/hooks/prepare-commit-msg
```
-–
The hook runs before each commit and removes any line containing the Cursor email. You’ll need to run this again if you clone the repo fresh (`.git/hooks/` is not version controlled).