Skip to content

Commit 678ef24

Browse files
Update scripts/remove-cursor-coauthor.sh
Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com>
1 parent ec21a9d commit 678ef24

1 file changed

Lines changed: 11 additions & 1 deletion

File tree

scripts/remove-cursor-coauthor.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,17 @@ set -e
66
cd "$(git rev-parse --show-toplevel)"
77

88
echo "=== Backup: creating backup-main branch (current state) ==="
9-
git branch backup-main 2>/dev/null || true
9+
if git rev-parse --verify backup-main >/dev/null 2>&1; then
10+
echo "WARNING: backup-main already exists. Delete it first or rename if you want a fresh backup."
11+
exit 1
12+
fi
13+
git branch backup-main
14+
15+
# Optionally backup all branches:
16+
echo "=== Creating backup refs for all branches ==="
17+
for branch in $(git for-each-ref --format='%(refname:short)' refs/heads/); do
18+
git branch "backup-$branch" "$branch" 2>/dev/null || true
19+
done
1020

1121
echo "=== Rewriting all commit messages to remove Cursor co-author line ==="
1222
git filter-branch -f --msg-filter 'sed "/^Co-authored-by: Cursor <cursoragent@cursor.com>$/d"' -- --all

0 commit comments

Comments
 (0)