Skip to content
Back to skills

Update Branch

ASecurity

Rebase a feature branch onto main and force-push it safely. Use when updating, rebasing, or syncing a branch with main, or resolving rebase conflicts.

  • 408 stars
  • 0 votes
  • 0 copies
  • 5 views
  • Added September 3, 2026
testinggobashgit

Security analysis

A100/100

Scanned September 3, 2026

npx -y skills add rhesis-ai/rhesis --skill update-branch --agent claude-code

Installs into .claude/skills of the current project.

Are you the author of Update Branch?

Add the live security badge to your README. It updates with every re-scan.

Security grade badge for Update Branch
[![Security: A — Skills Directory](https://www.skillsdirectory.com/api/skills/rhesis-ai-update-branch/badge)](https://www.skillsdirectory.com/skills/rhesis-ai-update-branch)

More formats (shields.io, HTML) on the badges page. Keep it an A: scan every change in CI with Pro.

Download with Pro
SKILL.md
---
name: update-branch
description: Rebase a feature branch onto main and force-push it safely. Use when updating, rebasing, or syncing a branch with main, or resolving rebase conflicts.
---

# Updating a Branch

**Rebase onto `main`; don't merge `main` into the branch.**

```bash
git fetch origin && git rebase origin/main
```

Merging leaves a merge commit and interleaves unrelated `main` changes into the branch's history,
which makes the PR diff noisy and stops the branch's own commits from reading as a clean sequence.

## Conflicts

Fix the files, `git add <file>`, then `git rebase --continue`. `git rebase --abort` puts the branch
back the way it was.

## Pushing after a rebase

A rebase rewrites history, so an already-pushed branch needs:

```bash
git push --force-with-lease
```

`--force-with-lease` refuses to overwrite commits someone else pushed, which plain `--force` will
do. On a branch someone else is working on, tell them before you force-push.

**Never force-push `main`.**

Pushing needs the user's go-ahead — see the commit rules in `AGENTS.md`.

Attribution

Is this your skill, or is something wrong with this listing? Request removal or report an issue. Author removals are honored within 72 hours.

View all in testing →

Comments

Loading comments…

Newsletter

Get the weekly list of safe new skills, and the ones we pulled.