sync-branch
/sync-branch
Synchronizuje bieżącą gałąź z main przez rebase: pobiera main, auto-stashuje zmiany i opcjonalnie wykonuje force-push.
- Autor
- dmzoneill ↗
- Repozytorium
- skills ↗
- Licencja
- Apache-2.0
- Ostatnia zmiana repozytorium
- 27.10.2026
Ocena i bezpieczeństwo
- Pliki w paczce
- 1
- Skrypty
- 0
- Komentarze HTML
- 0
- Adresy URL w SKILL.md
- 0
Brak sygnałów. Repozytorium zmienione 27.10.2026, bez odwołań do wycofanych modeli i API.
Apache-2.0, otwarta: można używać i zmieniać, z zachowaniem licencji i informacji o zmianach.
Co robi i kiedy
Synchronizuje bieżącą gałąź z main przez rebase: pobiera main, auto-stashuje zmiany i opcjonalnie wykonuje force-push.
Oryginalny opis (EN)
Quickly sync current branch with main using rebase. Use when you need to pull latest main into your feature branch, before creating MR or after ongoing work. Fetches main, rebases, auto-stashes changes, optionally force-pushes.
Jak działa
- Inputs
- Workflow
- MCP Tools
- Output Summary
Podgląd SKILL.md
---
name: sync-branch
description: Quickly sync current branch with main using rebase. Use when you need to pull latest main into your feature branch, before creating MR or after ongoing work. Fetches main, rebases, auto-stashes changes, optionally force-pushes.
---
# Sync Branch
Rebase current feature branch onto main. Less aggressive than `rebase_pr` — good for ongoing work.
## Inputs
| Input | Type | Default | Purpose |
|-------|------|---------|---------|
| `repo` | string | cwd | Repository path |
| `repo_name` | string | - | Config repo name (e.g. automation-analytics-backend) |
| `issue_key` | string | - | Jira key to resolve repo |
| `base_branch` | string | main | Branch to sync with |
| `stash_changes` | bool | true | Stash uncommitted changes before rebase |
| `force_push` | bool | false | Force push after successful rebase |
| `run_linting` | bool | true | Run black/flake8 before force push |
## Workflow
### 1. Load Persona
- `persona_load("developer")`
### 2. Resolve Repository
- Use `repo`, `repo_name`, `issue_key`, or cwd from config
- Get `default_branch` from config (usually main)
### 3. Pre-flight
- `git_status(repo)` — get current branch, check uncommitted changes
- Abort if on main/master
- If uncommitted changes and `stash_changes`: `git_stash(repo, action="push", message="sync_branch: auto-stash before rebase")`
### 4. Fetch
- `git_fetch(repo, prune=true)`
### 5. Check Commit Status
- `git_log(repo, range_spec="HEAD..origin/{base_branch}", count_only=true)` — commits behind
- `git_log(repo, range_spec="origin/{base_branch}..HEAD", count_only=true)` — commits ahead
### 6. Rebase (if behind > 0)
- `git_rebase(repo, onto="origin/{base_branch}")`
- On conflict: report conflict files, suggest `git add` + `git rebase --continue`
### 7. Pop Stash (if stashed and rebase success)
- `git_stash(repo, action="pop")`
### 8. Linting (if force_push and run_linting)
- `git_format` / `git_lint` — black, flake8
- Block push if lint fails
### 9. Force Push (if force_push and rebase success)
- `git_push(repo, branch="{current_branch}", force=true)`
### 10. Memory
- `memory_session_log("Synced branch {branch}", "behind: X, rebased: success")`
- On conflict: `learn_tool_fix("git_rebase", "conflict", "Merge conflicts", "Resolve manually, git add, git rebase --continue")`
## MCP Tools
- `persona_load`
- `git_status`
- `git_stash` (push/pop)
- `git_fetch`
- `git_log`
- `git_rebase`
- `git_push`
- `memory_session_log`
- `learn_tool_fix`
## Output Summary
- Already up to date / Successfully rebased / Conflicts detected
- If conflicts: list files, resolution steps
- If not pushed: `git push --force-with-lease origin {branch}`
Wersje
| Repozytorium | Wynik | Licencja |
|---|---|---|
| Ta strona · dmzoneill/skills | 90 | Apache-2.0 |
| Smana/cloud-native-ref | 100 | Apache-2.0 |
| mostafa-drz/claude-skills | 100 | MIT |
| itzcull/software-skills | 100 | MIT |
Migawka bazy z 28.10.2026 · wersja paczki c794fe9c597d (skrót SHA-256 całej paczki)
Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.
Podobne skille
- 90rebase-pr
Przenosi gałąź pull requesta na main, rozwiązuje konflikty, uruchamia lintery i wykonuje force push. - 100rebase
Pobiera najnowszą domyślną gałąź i przenosi na nią bieżącą gałąź, rozwiązując konflikty scaleń automatycznie, jeśli to możliwe. - 100sync
Aktualizuje bieżącą gałąź funkcji o najnowsze zmiany z gałęzi bazowej: domyślnie rebase, a na prośbę merge. - 100git-branch-sync
Pobiera najnowszą gałąź bazową i wykonuje rebase bieżącej gałęzi, czytelnie pokazując konflikty, gdy gałąź jest nieaktualna względem bazy. - 100rebase-latest-main
Pobiera najnowsze origin/main i stosuje je do bieżącej gałęzi przez rebase, rozwiązując konflikty, gdy trzeba zsynchronizować gałąź z upstreamem. - 90rebase-main
Aktualizuje lokalne main i przenosi bieżącą gałąź na nią, rozwiązując konflikty bez utraty lokalnych zmian.