Skip to content

Commit 65f2827

Browse files
committed
feat: add script to rebase all branches
1 parent 69cf109 commit 65f2827

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

scripts/rebase-all.sh

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#!/bin/bash
2+
3+
git fetch origin
4+
5+
for branch in $(git branch -r | grep -v HEAD); do
6+
# Remove the "origin/" prefix
7+
branch=${branch#origin/}
8+
9+
if [[ "$branch" != "main" ]]; then
10+
git checkout "$branch"
11+
git pull origin "$branch"
12+
git rebase main
13+
git push origin "$branch"
14+
fi
15+
done
16+
17+
git checkout main

0 commit comments

Comments
 (0)