Skip to content

Commit de657a8

Browse files
authored
Merge branch 'main' into fix/docker-base-image
2 parents b9f7e0c + 6698b6c commit de657a8

2 files changed

Lines changed: 33 additions & 0 deletions

File tree

.claude/skills/sync-git/SKILL.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
---
2+
name: sync-git
3+
description: Sync local repo with upstream, clean up branches and remotes
4+
disable-model-invocation: true
5+
allowed-tools: Bash
6+
---
7+
8+
Run `bash scripts/synch-git.sh` and report the output to the user.

scripts/synch-git.sh

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/usr/bin/env bash
2+
set -euo pipefail
3+
4+
echo "=== Syncing main with upstream ==="
5+
git fetch upstream main
6+
git checkout main
7+
git merge upstream/main --ff-only
8+
9+
echo ""
10+
echo "=== Pruning stale remote-tracking references ==="
11+
git fetch origin --prune
12+
git fetch upstream --prune
13+
14+
echo ""
15+
echo "=== Deleting local branches merged into main ==="
16+
merged=$(git branch --merged main | grep -v '^\*\|main' || true)
17+
if [ -n "$merged" ]; then
18+
echo "$merged" | xargs git branch -d
19+
else
20+
echo "No merged branches to delete."
21+
fi
22+
23+
echo ""
24+
echo "=== Done ==="
25+
git branch

0 commit comments

Comments
 (0)