Skip to content
DevBuildKit
AgentsSkillsCommandsPacksPricingDocsBlogTools
Log inGet DevBuildKit

Git Workflow

Safe, reviewable Git practice for AI agents and teams — branching, atomic commits, Conventional Commit messages, rebase versus merge, pull requests, recovery with reflog and revert, and destructive-command guardrails.

SkillFreev1.0.0
  1. Skills
  2. Git Workflow

What it does

Safe, reviewable Git practice for AI agents and teams — branching, atomic commits, Conventional Commit messages, rebase versus merge, pull requests, recovery with reflog and revert, and destructive-command guardrails.

Category
coregitworkflow
Platforms
generic
Frameworks and tools
git
Capabilities
workflowreview

Example tasks

  • “Split my working tree changes into clean atomic commits with good messages.”
  • “Update my feature branch onto main and resolve conflicts safely.”
  • “Undo a bad merge that already reached the shared branch.”

Works with

Recommended alongside

  • Git Worktrees· skill
  • Code Review· skill
  • Release Management· skill

Used by

  • Code Reviewer
  • Debugger
  • Release Shipper
  • Technical Writer
  • /branch
  • /changelog
  • /commit
  • /fix
  • /pr
  • /pr-review
  • /refactor
  • /release-check
  • /release-notes

Permissions summary

  • Files

    Reads files only

  • Shell

    No shell commands

  • Network

    No network

Permissions are declared in the component manifest and compiled into each client's tool list. Components are built for least privilege.

Supported environments

ClientSupportInstalled as
Claude CodeNative.claude/skills/<id>/SKILL.md
OpenAI CodexAdapter.codex/skills/<id>/SKILL.md
CursorAdapter.cursor/rules/<id>.mdc
VS Code (Copilot)Adapter.github/instructions/<id>.instructions.md
Generic markdownAdapterdocs/forgekit/skills/<id>.md

Claude Code is the native reference. Other clients use adapters, so behaviour is close but not identical. See the compatibility matrix.

Included in packs

  • android
  • engineering
  • flutter
  • ios
  • unity

Full skill (free preview)

This is a free component, so its complete content is public. It is exactly what gets installed (before client-specific formatting).

Git Workflow

Rules for making history that is reviewable, bisectable and recoverable. Follow the repository's documented flow (CONTRIBUTING.md, AGENTS.md) when it differs. Commit, push or open PRs only when the user asked you to.

1. Before you change anything

  • git status and git branch --show-current: know your branch and whether the tree is clean. Never start work on the default branch; create a branch.
  • git log --oneline -10 to learn the commit message style in use; match it.
  • Do not mix your changes with the user's uncommitted work. If the tree is dirty with unrelated changes, ask or stash them with a clear message.

2. Branching

  • Short-lived branches from an up-to-date default branch: git switch -c feat/invite-flow origin/main (after git fetch).
  • Names: type/short-kebab-description, optionally with an issue id (fix/1234-null-avatar). Types match commit types.
  • One purpose per branch. Long-running branches rot; integrate at least daily or use feature flags.

3. Commits

  • Atomic: one logical change that builds and passes tests. Separate refactors, formatting, dependency bumps and behavior changes.
  • Stage deliberately: git add -p or explicit paths. Avoid git add -A when untracked files might include secrets, build output or editor files; check git diff --staged before committing.
  • Message format (Conventional Commits, if the repo uses it):
    type(scope): imperative summary, <= 72 chars
    
    Why the change was needed and what behavior differs. Wrap at ~72.
    Refs: #123
    BREAKING CHANGE: description (when applicable)
    
    Types: feat, fix, docs, refactor, perf, test, build, ci, chore, revert.
  • Never commit secrets, .env files, credentials or large generated artifacts. If one slipped in, rotate the secret; rewriting history alone is not enough.
  • Fix up earlier commits in your own unpublished branch with git commit --fixup <sha> then git rebase -i --autosquash origin/main.

4. Rebase versus merge

SituationUse
Updating your private feature branch with maingit rebase origin/main (linear history)
Branch already pushed and shared with othersgit merge origin/main, or coordinate before rewriting
Landing a PRFollow repo policy: squash, rebase-merge or merge commit
Integrating a long-lived release branchMerge commit; preserve the history

Rules: never rewrite commits others have based work on. After rebasing your own pushed branch use git push --force-with-lease, never plain --force. Resolve conflicts by understanding both sides, then re-run tests; do not take "ours/theirs" wholesale without reading.

5. Pull requests

  • Small, focused, with a description covering what, why, how it was verified (commands and results), risks and rollback.
  • Link the issue. Keep unrelated cleanups out. Mark drafts as draft.
  • Address review feedback with new commits or fixups, and re-run the checks before requesting another round.

6. Recovery

ProblemCommand
Undo last commit, keep changesgit reset --soft HEAD~1
Discard unstaged changes in one filegit restore <path> (destructive, confirm first)
Unstagegit restore --staged <path>
Undo a pushed commit safelygit revert <sha> (merge commit: git revert -m 1 <merge-sha>)
Find lost commits after a bad reset/rebasegit reflog, then git switch -c rescue <sha>
Find the commit that broke somethinggit bisect start, git bisect bad, git bisect good <sha>, optionally git bisect run <test-command>
Abort a conflicted operationgit rebase --abort / git merge --abort

7. Guardrails

  • Ask before: git reset --hard, git clean -fd, git checkout -- ., git push --force, git branch -D, rewriting published history, or deleting remote branches.
  • Do not bypass hooks with --no-verify unless the user explicitly says so; fix the hook failure instead.
  • Do not change global git config; use repo-local config only when needed.
  • Never push to the default branch directly if branch protection or team policy exists.

Common mistakes

  • Giant "wip" commits that mix formatting, refactor and feature.
  • Force-pushing over a teammate's commits.
  • Resolving conflicts by deleting one side, then losing a bug fix.
  • Committing lockfile changes unrelated to the task.
  • Amending a commit that is already pushed and shared.

Version and changelog

Latest version 1.0.0. Requires DevBuildKit CLI 1.0.0 or newer.

Changelog — Git Workflow

1.0.0

  • Initial release.

Build with this skill

Create Demo Project

Install in CLI

$ devbuild add skill git-workflow

Dependencies are resolved automatically.

Free. Needs a free account: run devbuild login once.

IDgit-workflow
Version1.0.0
TierFree
DevBuildKit

Your entire AI development team. One install.

DevBuildKit never uploads your source code. Telemetry is opt-in and anonymous.

Product

  • Agents
  • Skills
  • Commands
  • Packs
  • Features
  • Live demo
  • Pricing

Learn

  • Documentation
  • Getting started
  • CLI reference
  • Blog
  • Changelog
  • Compare

Free tools

  • All tools
  • Agent generator
  • Config converter
  • Stack detector
  • Context analyzer

Use cases

  • Android development
  • iOS development
  • SaaS development
  • Backend development
  • App Factory
  • Game development

Company

  • Terms
  • Privacy
  • Refunds
  • Log in
  • Sign up

© 2026 DevBuildKit. All rights reserved.

DevBuildKit is an independent product. Claude, Claude Code, Anthropic, OpenAI, Codex, ChatGPT, Cursor, Visual Studio Code, GitHub Copilot, Microsoft and all other product names are trademarks of their respective owners. DevBuildKit is not affiliated with, endorsed by or sponsored by any of them; names are used only to describe compatibility.