We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 8336df3 commit 0f5c5ddCopy full SHA for 0f5c5dd
scripts/merge-all.sh
@@ -0,0 +1,29 @@
1
+#!/bin/bash
2
+
3
+if [ $# -ne 1 ]; then
4
+ echo "./merge-all.sh <commit-message>"
5
+ exit 1
6
+fi
7
8
+git fetch origin
9
10
+for branch in $(git branch -r | grep -v HEAD); do
11
+ # Remove the "origin/" prefix
12
+ branch=${branch#origin/}
13
14
+ if [[ "$branch" != "main" ]]; then
15
+ git checkout "$branch"
16
+ if [[ $? -ne 0 ]]; then
17
+ echo "Checkout failed for branch $branch"
18
19
+ fi
20
+ git merge --squash main
21
22
+ echo "Merge failed for branch $branch"
23
24
25
+ git commit -m "$1"
26
27
+done
28
29
+git checkout main
0 commit comments