update-branch
/update-branch
Use only when the user explicitly asks to update the current local feature branch from origin's default branch. Merge in place in a clean ordinary checkout; no branch switching, rebase, push, or feature-upstream sync.
- Author
- nebius ↗
- Repository
- nebius-ps-services ↗
- Licence
- Apache-2.0
- Last repository change
- 26.10.2026
Assessment and security
- Files in this package
- 22
- Scripts
- 0
- HTML comments
- 0
- URLs in SKILL.md
- 0
No signals detected. Repository changed on 26.10.2026, without references to retired models or APIs.
Apache-2.0, otwarta: można używać i zmieniać, z zachowaniem licencji i informacji o zmianach.
What it does and when to use it
Use only when the user explicitly asks to update the current local feature branch from origin's default branch. Merge in place in a clean ordinary checkout; no branch switching, rebase, push, or feature-upstream sync.
Original author description
Use only when the user explicitly asks to update the current local feature branch from origin's default branch. Merge in place in a clean ordinary checkout; no branch switching, rebase, push, or feature-upstream sync.
How it works
- Help
- Usage
- Scope
- Workflow
- Learning Loop
SKILL.md preview
---
name: update-branch
description: "Use only when the user explicitly asks to update the current local feature branch from origin's default branch. Merge in place in a clean ordinary checkout; no branch switching, rebase, push, or feature-upstream sync."
disable-model-invocation: true
---
# Update Branch
## Help
For `$update-branch --help` or `$update-branch -h` (including native Claude forms), return concise help and stop before
any workflow step. State the purpose and invocation policy. Show exact usage
for every public action. Describe each public action, positional
argument, and flag in one concise line, including `-h, --help`; say "No
additional public flags" when there are no others. Use only the documented
public interface. For internal or coordinator-only skills, state that boundary
and that no standalone public workflow action exists. After the selected
`SKILL.md` is loaded, help is report-only: do not call any additional tools,
inspect project state, or modify files, private state, Git, or external systems.
Never expose private helper actions or flags or treat help as workflow
authorization.
## Usage
- `$update-branch`: merge origin's default into the checked-out feature branch.
- `$update-branch -h` or `$update-branch --help`: show help only.
No positional arguments. No additional public flags.
## Scope
Use `$update-branch` in Codex, `/update-branch` in Claude Code, or
`/skills:update-branch` in the Claude plugin. Requires Git and existing origin
access. Invocation authorizes this local merge and clear conflict resolutions,
including a merge commit when needed. Honor host mode, project rules and hooks.
Do not route through commit transactions or request another routine approval.
Stay small and fast: use Git directly; no execution helper, custom state,
GitHub API, full-repository test suite, or installation step. Read applicable
project instructions; inspect source and run focused tests only for conflicts.
## Workflow
### 1. Check eligibility
Resolve the Git root, named branch and starting HEAD. Run from that root.
Require one Git writer; stop if branch, HEAD or local changes move unexpectedly.
Use NUL-delimited output when parsing paths. Check cleanliness with:
```bash
git --no-optional-locks status --porcelain=v1 -z --untracked-files=all --ignore-submodules=none
```
Stop for any staged, unstaged or untracked changes, including dirty submodules.
Tell the user: "Review, stage, and commit your work, then rerun `$update-branch`
once the working directory is clean." For dirty submodules, resolve their local
work first. Do not stage or commit existing work automatically.
Resolve operation paths through `git rev-parse --git-path`; stop for existing
merge, rebase/am, cherry-pick, revert, sequencer or bisect state. Do not remove
locks or repair somebody else's operation. Reject detached or unborn HEAD.
Read the full current ref with `git symbolic-ref --quiet HEAD` and registrations
with `git worktree list --porcelain -z`. Stop if identity or records cannot be
determined reliably. Exclude Git's first (primary) record; block only linked
records whose `branch` exactly equals the current ref, including locked/prunable
records and invocation inside that linked checkout. Report the branch and path;
report inspection failures separately. Recheck this association before merging.
Unrelated/detached worktrees, sibling directories/symlinks and `worktreeSkill`
metadata alone (even on the current branch) do not block. Do not infer a link from
ancestry, shared commits or another worktree's source-branch reference.
Honor active workflow restrictions applicable to the current branch/checkout and
explicit repository-wide Git-write locks. Do not infer active ownership from
metadata or folder presence alone, parse private owner schemas, call publication
guards under a false action, or repair/delete records to pass this check.
Inspect effective `branch.<current>.mergeOptions` and custom merge strategies.
Stop for conflicting or unrecognized options: hook/signature bypass, squash,
no-commit, unrelated histories, autostash, ignored-file overwrite, or blanket
ours/theirs policies. Preserve normal hooks, signing and verification settings.
Do not silently edit configuration or bypass a hook rejection.
### 2. Discover and fetch
Require the named remote `origin`; never choose another remote silently.
Query `git ls-remote --symref origin HEAD`. Require one symbolic target under
`refs/heads/`, validate its branch name, and record it as `update_default`.
Do not guess `main` or trust cached `origin/HEAD`. Stop on the default branch.
Fetch only that branch, with quoted values and no configured refmap side effects:
```bash
git fetch --no-tags --no-prune --no-recurse-submodules --refmap= origin \
"refs/heads/$update_default:refs/remotes/origin/$update_default"
```
Stop on fetch/authentication failure; never merge a stale cached ref. Resolve
`refs/remotes/origin/$update_default^{commit}` into `update_target` and freeze it.
Stop for unrelated history or insufficient shallow history; do not automatically
deepen, force history, or merge the current branch's separate upstream.
### 3. Merge in place
Recheck eligibility, branch and starting HEAD immediately before merging.
If the frozen target is already an ancestor of HEAD, verify and report no-op.
Otherwise use the frozen commit, allowing fast-forward or a normal merge commit:
```bash
git merge --ff --no-edit --no-autostash --no-overwrite-ignore \
--no-rerere-autoupdate "$update_target"
```
Inspect exit status and Git state together. A nonzero exit may mean conflicts,
a hook/signing error, or another failure; never blindly retry or claim success.
Ignored-file collisions stop the merge rather than discard those local files.
### 4. Resolve only clear conflicts
For this task's pending merge, confirm branch, original HEAD and `MERGE_HEAD`
still match the recorded inputs. Do not adopt an unrelated pending merge.
Inspect every conflicted path, both sides' intent, and reused rerere resolutions;
no blanket ours/theirs selection. Resolve only when intent is clear. Ask about
ambiguous behavior and leave the merge pending while awaiting the answer.
Run the narrowest applicable checks on resolutions. Review the complete staged
and unstaged diff, ensure no unmerged entries remain after staging, and never
include new unrelated work. Before staging, verify every changed/untracked path
belongs to this merge; otherwise stop. Stage with `git add -A` from the root.
Inspect `git diff --cached --check` and the staged result, then finish with
`GIT_EDITOR=true git merge --continue`, retaining hooks and signing. If checks,
hooks or signing fail, report the failure and pending state; do not bypass it,
auto-abort, reset, or create an unrelated commit. Recheck state before resuming.
### 5. Verify and report
Require the original branch, both starting HEAD and frozen target as ancestors
of final HEAD (`git merge-base --is-ancestor`), no pending Git operation, and
clean status using the same explicit command. Inspect any failure before
reporting completion; a successful command alone is insufficient. Submodule
checkout mismatches or test-created files are reported, never auto-cleaned.
Report branch, source default/ref and fetched SHA, outcome (already current,
fast-forwarded, merged, or blocked), resulting HEAD, conflict/check results when
applicable, and remaining work. Do not expose remote URLs or raw logs. Updates
are local; never push, switch, rebase, stash, reset, prune or change tracking.
A repeat invocation with the same merged target is a no-op. State rechecks are
not a concurrency lock; stop on competing activity rather than promise isolation.
## Learning Loop
When using this skill, capture durable, reusable, public-safe learnings
in the narrowest appropriate surface only when the task contract allows source edits.
For read-only/report-only work, or when a learning is not public-safe,
evidence-backed, in scope, or free of unverified/vendor-specific claims, do not
edit skill sources; report that it was skipped. Do not capture secrets, private
URLs, customer data, raw logs, or one-off local state.
Files in this package (22)
- README.md 3 KB
- SKILL.md 8 KB
- agents/openai.yaml 1 KB
- evals/evals.json 16 KB
- evals/trigger-prompts.csv 1 KB
- evals/fixtures/already-current.json 1 KB
- evals/fixtures/ambiguous-conflict.json 1 KB
- evals/fixtures/clear-conflict.json 1 KB
- evals/fixtures/dirty-hidden-files.json 1 KB
- evals/fixtures/divergent-merge.json 1 KB
- evals/fixtures/fast-forward.json 1 KB
- evals/fixtures/hook-bypass.json 1 KB
- evals/fixtures/hook-failure.json 1 KB
- evals/fixtures/ignored-collision.json 1 KB
- evals/fixtures/ineligible-checkouts.json 1 KB
- evals/fixtures/postcondition-failure.json 1 KB
- evals/fixtures/renamed-default.json 1 KB
- evals/fixtures/rerere-and-new-work.json 1 KB
- evals/fixtures/stale-fetch-failure.json 1 KB
- evals/fixtures/worktree-associated.json 3 KB
- evals/fixtures/worktree-inspection.json 3 KB
- evals/fixtures/worktree-unrelated.json 3 KB
Versions
| Repository | Score | Licence |
|---|---|---|
| This page · nebius/nebius-ps-services | 95 | Apache-2.0 |
| kmedi355/team-git-skills | 100 | MIT |
Database snapshot: 13.11.2026 · package version 68471750f763 (SHA-256 digest of the entire package)
Downloads in the last 30 days: 4 · ranking
Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.
Similar skills
- 100rebase
Rebases the current feature branch onto the base branch (main/master/develop). Use when the user says "rebase", "sync branch", or "update branch". - 100rebase-current-branch
Rebase the currently checked out feature branch onto the latest upstream default branch. Use when asked to update a branch with main or master, rebase the current branch onto the default branch, or sync a feature branch before review. Detects whether the repository uses main or… - 100update-origin
Updates the current branch from an origin branch via standard merge, with a recoverable backup and safe conflict resolution. Use when the user runs /update-origin or asks to update, sync, or merge their branch with main (or another origin branch). - 100rebase
Fetch the latest default branch and rebase the current branch on top of it, resolving any merge conflicts automatically. Use when asked to "rebase", "rebase on main", "update branch with main", "sync with main", "rebase onto latest", or "/rebase". - 100git-rebase-sync
Use when syncing a feature branch onto the latest origin base branch via git rebase. - 100git-feature-branch-sync
Rebase vs merge a feature branch; force-push safely. TRIGGER when: syncing a feature branch with the default branch or deciding whether and how to force-push. DO NOT TRIGGER when: routine work on a clean branch, operating on shared/default branches (never force-push them), or…