Git Workflow — Conflicts · Commits · CI/CD
Purpose
Three focused Git workflows, each done end-to-end by Claude (never hand a git
command back to the user — run it):
- Conflict resolution with a decision log.
- Commit message authoring from the real diff (Conventional Commits).
- CI/CD pipeline authoring for GitHub Actions.
Language: explanations in Hebrew; commit messages, YAML, and code in English.
Workflow A — Resolve merge/rebase conflicts (with documented decisions)
Trigger: "resolve the merge conflicts in this branch and explain what you kept from each side".
- Survey —
git status to list conflicted files; git log --oneline --left-right --merge and git diff to understand both sides. Know which branch is "ours" vs
"theirs" and what each was trying to do.
- Resolve each hunk on merit, not mechanically:
- Understand the intent of both sides before choosing.
- Prefer a resolution that keeps both intents when they're compatible (e.g. two
independent additions) rather than dropping one.
- Never blindly take one side across the board.
- Watch for semantic conflicts that aren't textual (both sides compile, logic
still breaks) — reason about behavior, not just markers.
- Remove all conflict markers, then verify: build + run the test suite. A "resolved"
branch that doesn't compile isn't resolved.
- Document the decisions — for each conflicted file, one line: what you kept from
each side and why. Present this table in Hebrew to the user before committing.
- Complete the merge/rebase (
git add + git commit / git rebase --continue).
Do not push --force to a shared branch without explicit approval.
Workflow B — Professional commit message from the diff
Trigger: "commit these changes with a message that summarizes what I did".
- Inspect the actual change:
git status, git diff --staged (and unstaged).
Stage the intended files (git add -p mentally — group only related changes).
- If the staged changes are really several unrelated things, propose splitting into
atomic commits, one logical change each.
- Write a Conventional Commit:
- Type:
feat / fix / refactor / docs / test / chore / perf / style.
type(scope): concise summary in imperative mood (≤ ~72 chars).
- Body (when non-trivial): why, notable decisions, breaking changes
(
BREAKING CHANGE: footer).
- Summarize what the diff does, not a file listing.
- If this repo's commits end with a
Co-Authored-By trailer, keep the convention.
- Commit. Never
--no-verify or skip signing unless the user explicitly asks. If a
hook fails, fix the underlying issue.
Workflow C — CI/CD GitHub Actions pipeline
Trigger: "write a GitHub Actions workflow that runs tests, builds, and deploys to staging on every push to develop".
- Learn the project: language/runtime + versions, package manager + lockfile,
test/build/deploy commands, and the deploy target (Vercel, Railway, AWS, Docker,
Pages…). Read
package.json / pyproject.toml / existing .github/workflows.
- Author
.github/workflows/*.yml with:
- Correct
on: triggers (e.g. push: branches: [develop], plus pull_request
for the test job if useful).
- Jobs wired by
needs: — typically test → build → deploy — so deploy only
runs on green.
- Dependency caching (
actions/setup-node cache, actions/cache), pinned action
versions, matrix only if genuinely needed.
- Deploy step using the target's official action/CLI; environment via
environment: and secrets.* — never hardcode secrets.
- List required secrets for the user to add in repo settings (names only, with a
one-line description each) — the one thing Claude can't set.
- Sanity-check the YAML (indentation, valid keys). Note anything that can only be
fully verified by an actual run, and offer to trigger/watch it.
Rules
- Run every git command yourself; don't ask the user to run it.
- Atomic commits, conventional messages, no secrets in code.
push --force / history rewrites on shared branches → confirm first.
1---2name: git-workflow3description: Hands-on Git workflows: resolve merge/rebase conflicts with a documented rationale, generate professional Conventional-Commit messages from the actual diff, and author complete CI/CD GitHub Actions pipelines. TRIGGER when the user says 'resolve the merge conflicts in this branch and explain what you kept from each side', 'commit these changes with a message that summarizes what I did', 'write a GitHub Actions workflow that runs tests, builds, and deploys to staging on push to develop', or similar. Hebrew: 'תפתור את הקונפליקטים', 'תסביר מה שמרת מכל צד', 'תעשה commit עם הודעה טובה', 'תכתוב workflow ל-GitHub Actions', 'CI/CD', 'pipeline של דיפלוי'. Follows the global Git Hygiene rules (atomic commits, conventional messages). NOT for routine `git status`/`git log` questions — just answer those directly.4---56# Git Workflow — Conflicts · Commits · CI/CD78## Purpose9Three focused Git workflows, each done end-to-end by Claude (never hand a git10command back to the user — run it):11- **Conflict resolution** with a decision log.12- **Commit message** authoring from the real diff (Conventional Commits).13- **CI/CD pipeline** authoring for GitHub Actions.1415**Language:** explanations in Hebrew; commit messages, YAML, and code in English.1617---1819## Workflow A — Resolve merge/rebase conflicts (with documented decisions)20Trigger: "resolve the merge conflicts in this branch and explain what you kept from each side".21221. **Survey** — `git status` to list conflicted files; `git log --oneline --left-right23 --merge` and `git diff` to understand both sides. Know which branch is "ours" vs24 "theirs" and what each was trying to do.252. **Resolve each hunk on merit**, not mechanically:26 - Understand the intent of both sides before choosing.27 - Prefer a resolution that keeps *both* intents when they're compatible (e.g. two28 independent additions) rather than dropping one.29 - Never blindly take one side across the board.30 - Watch for semantic conflicts that aren't textual (both sides compile, logic31 still breaks) — reason about behavior, not just markers.323. **Remove all conflict markers**, then verify: build + run the test suite. A "resolved"33 branch that doesn't compile isn't resolved.344. **Document the decisions** — for each conflicted file, one line: what you kept from35 each side and *why*. Present this table in Hebrew to the user before committing.365. Complete the merge/rebase (`git add` + `git commit` / `git rebase --continue`).37 Do **not** `push --force` to a shared branch without explicit approval.3839---4041## Workflow B — Professional commit message from the diff42Trigger: "commit these changes with a message that summarizes what I did".43441. Inspect the **actual change**: `git status`, `git diff --staged` (and unstaged).45 Stage the intended files (`git add -p` mentally — group only related changes).462. If the staged changes are really several unrelated things, propose splitting into47 **atomic commits**, one logical change each.483. Write a **Conventional Commit**:49 - Type: `feat` / `fix` / `refactor` / `docs` / `test` / `chore` / `perf` / `style`.50 - `type(scope): concise summary in imperative mood` (≤ ~72 chars).51 - Body (when non-trivial): *why*, notable decisions, breaking changes52 (`BREAKING CHANGE:` footer).53 - Summarize what the diff *does*, not a file listing.544. If this repo's commits end with a `Co-Authored-By` trailer, keep the convention.555. Commit. Never `--no-verify` or skip signing unless the user explicitly asks. If a56 hook fails, fix the underlying issue.5758---5960## Workflow C — CI/CD GitHub Actions pipeline61Trigger: "write a GitHub Actions workflow that runs tests, builds, and deploys to staging on every push to develop".62631. **Learn the project**: language/runtime + versions, package manager + lockfile,64 test/build/deploy commands, and the deploy target (Vercel, Railway, AWS, Docker,65 Pages…). Read `package.json` / `pyproject.toml` / existing `.github/workflows`.662. **Author `.github/workflows/*.yml`** with:67 - Correct `on:` triggers (e.g. `push: branches: [develop]`, plus `pull_request`68 for the test job if useful).69 - Jobs wired by `needs:` — typically `test` → `build` → `deploy` — so deploy only70 runs on green.71 - Dependency caching (`actions/setup-node` cache, `actions/cache`), pinned action72 versions, matrix only if genuinely needed.73 - Deploy step using the target's official action/CLI; environment via74 `environment:` and `secrets.*` — **never hardcode secrets**.753. **List required secrets** for the user to add in repo settings (names only, with a76 one-line description each) — the one thing Claude can't set.774. Sanity-check the YAML (indentation, valid keys). Note anything that can only be78 fully verified by an actual run, and offer to trigger/watch it.7980---8182## Rules83- Run every git command yourself; don't ask the user to run it.84- Atomic commits, conventional messages, no secrets in code.85- `push --force` / history rewrites on shared branches → confirm first.