git-workflow
/git-workflow
Use when working with git beyond writing a commit message — branching, rebasing vs merging, resolving conflicts, recovering lost work, and bisecting to find a bad commit. Covers what is safe on shared branches and what is not.
- Author
- alisinadevelo ↗
- Repository
- md-files ↗
- Licence
- MIT
- Last repository change
- 03.10.2026
Assessment and security
- Files in this package
- 1
- Scripts
- 0
- HTML comments
- 0
- URLs in SKILL.md
- 0
No signals detected. Repository changed on 03.10.2026, without references to retired models or APIs.
MIT, open: use and modify while retaining author attribution.
What it does and when to use it
Use when working with git beyond writing a commit message — branching, rebasing vs merging, resolving conflicts, recovering lost work, and bisecting to find a bad commit. Covers what is safe on shared branches and what is not.
Original author description
Use when working with git beyond writing a commit message — branching, rebasing vs merging, resolving conflicts, recovering lost work, and bisecting to find a bad commit. Covers what is safe on shared branches and what is not.
How it works
- Branching
- Rebase vs. merge — the one rule that matters
- Resolving conflicts
- Recovery — git rarely loses committed work
- Finding a bad commit
- Don't
SKILL.md preview
---
name: git-workflow
description: >-
Use when working with git beyond writing a commit message — branching, rebasing
vs merging, resolving conflicts, recovering lost work, and bisecting to find a bad
commit. Covers what is safe on shared branches and what is not.
---
# Git Workflow
Git is a content-addressable history you can almost always recover from. The rules below
keep history readable and keep you out of the irreversible corners.
## Branching
- Branch per unit of work off the latest base. Keep branches short-lived — long-lived
branches drift and conflict.
- Rebase your *own* unpushed branch onto the updated base to keep a linear history before
opening a PR: `git fetch && git rebase origin/main`.
- For an explicitly owned stacked-PR branch, rebasing after publication can be part of the
documented workflow. Fetch first, save recovery refs, inspect active review, restack
descendants bottom-up, and push only with `--force-with-lease`. Use the
`stacked-changes` skill for the full protocol.
## Rebase vs. merge — the one rule that matters
- **Rebase private history or explicitly owned stack branches.** Never rewrite a branch
others may have based work on unless that repository's stack workflow establishes
ownership and recovery. A pushed stack is not automatically shared, but ownership must
be known and `--force-with-lease` is mandatory.
- **Merge to integrate shared branches.** A merge commit is honest about when integration
happened and is safe for history others already have.
## Resolving conflicts
- Read both sides before editing — understand what each change intended, don't just pick
one. The conflict markers (`<<<<<<<`, `=======`, `>>>>>>>`) bound the competing hunks.
- After resolving: `git add` the files, then continue (`git rebase --continue` /
`git merge --continue`). Run the tests before finishing — a clean merge can still be
semantically broken.
- Bail out safely if it's a mess: `git rebase --abort` / `git merge --abort` returns you
to the pre-operation state.
## Recovery — git rarely loses committed work
- **`git reflog`** is the undo log for HEAD. Reset to the wrong place, botched a rebase,
"lost" a branch? The prior HEAD is in the reflog: `git reset --hard HEAD@{1}`.
- **`git revert <sha>`** undoes a commit by adding an inverse commit — the safe way to
undo something already pushed (vs. `reset`, which rewrites history).
- Uncommitted changes are the real loss risk — `git stash` before risky operations.
## Finding a bad commit
`git bisect` binary-searches history for the commit that introduced a bug:
```text
git bisect start
git bisect bad # current commit is broken
git bisect good <known-good> # this older commit worked
# git checks out the midpoint — test it, then:
git bisect good # or: git bisect bad
# repeat until git names the first bad commit, then:
git bisect reset
```
Automate it with `git bisect run <test-command>` when the test is scriptable.
## Don't
Force-push to `main`/`master`/`shared` branches. Rewrite pushed history others build on.
Bypass a rejected `--force-with-lease` with `--force`. `git reset --hard` with uncommitted
changes you care about. `git clean -fd` without checking what it'll delete first
(`git clean -nd` previews).
Versions
| Repository | Score | Licence |
|---|---|---|
| This page · alisinadevelo/md-files | 100 | MIT |
| event4u-app/agent-config | 100 | MIT |
| lee-w/maigo | 100 | MIT |
| hakula139/plugins | 100 | MIT |
| ericrisco/rsc-harness | 100 | MIT |
| Sanit-mann/The-Insectoids | 100 | MIT |
| eliyce/paqad-ai | 100 | MIT |
| langfuse/langfuse | 100 | MIT |
| Muvon/octomind-tap | 100 | Apache-2.0 |
Database snapshot: 13.11.2026 · package version 4275d82a03ee (SHA-256 digest of the entire package)
Downloads in the last 30 days: 0 · ranking
Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.
Similar skills
- 90Git Workflow
Trunk-based git workflow for NXTG-Forge — branching strategy, commit conventions, PR practices, rebase/conflict resolution, and how the plugin's own hooks guard git operations. Use when creating a feature branch, writing a commit message or PR, rebasing onto main, resolving… - 100git-advanced
Use when performing complex git operations -- rebasing, cherry-picking, resolving merge conflicts, bisecting bugs, managing stashes, cleaning history, or working with monorepos. Goes beyond basic commit/push/pull. - 100git
Guide for Git operations including commits, branches, rebasing, and conflict resolution. Use when working with version control, creating commits, managing branches, or resolving merge conflicts. - 100git
Advanced Git workflows skill. Branching models, merge vs rebase, interactive rebase, git bisect, cherry-pick, worktrees, commit conventions. Triggers on: /godmode:git, "branching strategy", "rebase vs merge", "git bisect", "cherry-pick". - 96resolving-merge-conflicts
Use when you need to resolve an in-progress git merge/rebase conflict. - 96resolving-merge-conflicts
Use when you need to resolve an in-progress git merge/rebase conflict.