File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 66cd " $( git rev-parse --show-toplevel) "
77
88echo " === 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
1121echo " === Rewriting all commit messages to remove Cursor co-author line ==="
1222git filter-branch -f --msg-filter ' sed "/^Co-authored-by: Cursor <cursoragent@cursor.com>$/d"' -- --all
You can’t perform that action at this time.
0 commit comments