Dev update working branch

From Nebulavenus/forge-gpu · View interactive version

Dev update working branch is an AI agent skill from the GitHub repository Nebulavenus/forge-gpu. Update the current working branch with the latest main. Fetches origin/main, updates local main, and rebases the current branch onto main.

How to use this skill

Skill file

Update the current working branch with the latest changes from main.

Fetches origin/main, fast-forwards local main, and rebases the

current feature branch onto main for clean linear history.

When to use

Workflow

1. Verify on a feature branch

BRANCH=$(git branch --show-current)

If on main, report "Already on main — use git pull instead" and stop.

Check for uncommitted or untracked changes:

test -z "$(git status --porcelain=v1 --untracked-files=all)"

If the output is non-empty, report "Uncommitted changes detected — commit

or stash before updating" and stop. This catches tracked modifications,

staged changes, and untracked files (which can cause "would be overwritten

by rebase" errors).

2. Fetch and update local main

git fetch origin main
git branch -f main origin/main

This updates local main to match origin/main without switching

branches. The -f flag forces the update (safe because we are not on

main).

3. Rebase onto main

git rebase main

If there are conflicts, report them and stop — the user must resolve

manually with git rebase --continue or git rebase --abort.

4. Report result

Updated <branch-name> with latest main.
- Fetched origin/main
- Local main updated to <commit>
- Rebased <branch-name> onto main
- <N> new commits from main

Rebase rewrites history — push with: git push --force-with-lease

If the rebase was a no-op (already up to date), report that instead.

What it does NOT do

Safety

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.