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.
Rebase current feature branch onto main. Less aggressive than rebase_pr — good for ongoing work.
| 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 |
persona_load("developer")repo, repo_name, issue_key, or cwd from configdefault_branch from config (usually main)git_status(repo) — get current branch, check uncommitted changesstash_changes: git_stash(repo, action="push", message="sync_branch: auto-stash before rebase")git_fetch(repo, prune=true)git_log(repo, range_spec="HEAD..origin/{base_branch}", count_only=true) — commits behindgit_log(repo, range_spec="origin/{base_branch}..HEAD", count_only=true) — commits aheadgit_rebase(repo, onto="origin/{base_branch}")git add + git rebase --continuegit_stash(repo, action="pop")git_format / git_lint — black, flake8git_push(repo, branch="{current_branch}", force=true)memory_session_log("Synced branch {branch}", "behind: X, rebased: success")learn_tool_fix("git_rebase", "conflict", "Merge conflicts", "Resolve manually, git add, git rebase --continue")persona_loadgit_statusgit_stash (push/pop)git_fetchgit_loggit_rebasegit_pushmemory_session_loglearn_tool_fixgit push --force-with-lease origin {branch}