agentsclimarketplace

Git workflow

Skill iceflower/agent-skills/git-workflow

Agent Skills 오픈 표준 기반 AI 코딩 에이전트용 스킬 컬렉션 (Java, Kotlin, Spring, NestJS, K8s, Terraform, GraphQL, gRPC, OpenTelemetry, a11y, i18n 등 60개)

Install
npx -y skills add iceflower/agent-skills --skill git-workflow

Assembled from the repository path, not quoted from the project. Check it against their README if it does not work.

One thing to look at

  • 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.

What its author says it does

Copied from the file, not written here

Git commit conventions, branch strategy, and collaboration workflow rules. Covers conventional commits, commit message formatting, squash merge, rebase, interactive rebase, branch naming conventions, merge conflict resolution, cherry-pick, git bisect, and pull request workflows. Use when committing code, managing branches, resolving merge conflicts, or defining a team Git branching strategy.

The file declares its own license as MIT. That is the author’s claim about this one file, and it is not the same thing as the license GitHub reports for the repository, which is listed with the other numbers below.

SKILL.md

11.1 KB, as published. Nobody here has run it

Git Workflow Rules

1. Commit Message Convention

Format

<type>(<scope>): <subject>

[optional body]

[optional footer]

Types

TypeDescription
featNew feature
fixBug fix
docsDocumentation changes
styleCode formatting (no logic change)
refactorCode refactoring
testAdding/updating tests
choreBuild/config changes
perfPerformance improvement
ciCI/CD configuration changes
revertRevert previous commit

Writing Rules

  • Subject line under 50 characters
  • Use imperative mood (Add, Fix, Update, etc.)
  • No period at end of subject
  • Wrap body at 72 characters
  • Explain "what" and "why" in body, not "how"

Example

feat(auth): Add JWT token refresh logic

Previously, users had to re-login when token expired.
Added refresh token mechanism for automatic renewal.

Closes #123

2. Branch Strategy

Branch Structure

BranchPurposeProtected
mainProduction deploymentYes
developDevelopment integrationYes
feature/*Feature developmentNo
release/*Release preparationNo
hotfix/*Production hotfixNo
bugfix/*Bug fix (from develop)No

Branch Naming

feature/<issue-number>-<short-description>   # e.g., feature/123-add-login
bugfix/<issue-number>-<short-description>    # e.g., bugfix/456-fix-auth-error
hotfix/<issue-number>-<short-description>    # e.g., hotfix/789-patch-crash
release/<version>                            # e.g., release/1.2.0

Merge Strategy

  • featuredevelop: Squash and merge
  • releasemain: Merge commit
  • hotfixmain + develop: Merge commit

3. Pull Request Guidelines

PR Title

Same format as commit message: <type>(<scope>): <subject>

PR Description Template

## Summary

- Brief description of changes

## Changes

- Specific changes made

## Test Plan

- [ ] Test item 1
- [ ] Test item 2

## Screenshots (if UI changes)

## Related Issues

Closes #<issue-number>

Pre-Review Checklist

  • Commit message convention followed
  • Unnecessary files/comments removed
  • Conflicts resolved
  • CI passed

4. Commit Practices

Atomic Commits

  • One commit = one logical change
  • Do not mix "feature + bugfix + refactor" in single commit

Commit Split Example

# Bad
git commit -m "Add login feature and fix header bug and update README"

# Good
git commit -m "feat(auth): Add login feature"
git commit -m "fix(ui): Fix header alignment"
git commit -m "docs: Update README with login instructions"

FAQ

How to amend the last commit message

git commit --amend

How to squash multiple commits

git rebase -i HEAD~3

5. Git Safety Rules

Never Do

  • git push --force on main/master/develop
  • Commit secrets to public repositories
  • Modify pushed commits after rebase/force push

Recovery Guide

SituationSolution
Committed to wrong branchgit cherry-pick or git reset
Committed sensitive infogit filter-repo or BFG Cleaner
Want to undo mergegit reset --hard ORIG_HEAD
Restore specific filegit checkout HEAD~1 -- <file>

6. Rebase Workflow

Rebase vs Merge: When to Use Which

ScenarioRecommended
Updating a local feature branchRebase
Integrating a shared/protected branchMerge
Cleaning up commit history before PRRebase (interactive)
Preserving exact merge timelineMerge

Golden rule: Never rebase commits that have been pushed to a shared branch.

Rebasing onto the Base Branch

# Update feature branch with latest changes from develop
git checkout feature/123-add-login
git fetch origin
git rebase origin/develop

Interactive Rebase

Use git rebase -i to clean up commit history before opening a PR.

ActionEffect
pickKeep the commit as-is
rewordKeep the commit but edit its message
squashCombine with previous commit, keep message
fixupCombine with previous commit, discard message
dropRemove the commit entirely
# Squash the last 4 commits into one
git rebase -i HEAD~4

Handling Rebase Conflicts

  1. Resolve conflicts in the affected files and stage them: git add <file>.
  2. Continue: git rebase --continue.
  3. To abort and restore the original state: git rebase --abort.

7. Cherry-pick

Use Cases

  • Backporting a bug fix from develop to a release/* or hotfix/* branch
  • Applying a specific commit to another branch without merging the entire branch
  • Recovering a commit from a deleted or abandoned branch

Basic Usage

git cherry-pick <commit-hash>                       # single commit
git cherry-pick <hash-1> <hash-2>                   # multiple commits
git cherry-pick <start-hash>..<end-hash>            # range (exclusive of start)

Important Considerations

  • Cherry-picked commits get new hashes; the original and copy are independent.
  • Avoid cherry-picking merge commits unless necessary (use -m 1 to specify mainline parent).
  • If the same change is later merged normally, expect potential conflicts.
  • Always verify the result compiles and passes tests after cherry-picking.

8. Merge Conflict Resolution

Prevention

  • Rebase feature branches frequently, keep PRs small, and communicate about shared file ownership.

Resolution Steps

  1. Identify conflicting files: git status shows "both modified" entries.
  2. Open each file, find conflict markers (<<<<<<< / ======= / >>>>>>>), and decide which changes to keep.
  3. Remove all conflict markers and stage resolved files: git add <file>.
  4. Complete: git commit (for merge) or git rebase --continue (for rebase).

Tools

ToolCommand / Setup
vimdiffgit mergetool --tool=vimdiff
VS CodeOpen conflicting file; use inline UI
IntelliJVCS → Git → Resolve Conflicts
diff3git config merge.conflictstyle diff3

Using diff3 style adds the common ancestor between the two sides, making conflict resolution easier.


9. Git Bisect

Purpose

Efficiently find the commit that introduced a bug using binary search.

Basic Workflow

git bisect start
git bisect bad                   # mark current (broken) commit
git bisect good <known-good-hash> # mark a known-good commit

# Git checks out a middle commit — test it, then mark good or bad.
# Repeat until Git identifies the first bad commit.

git bisect reset                 # end session, return to original branch

Automated Bisect

Provide a test script that exits 0 for good and non-zero for bad:

git bisect start HEAD <known-good-hash>
git bisect run ./test-script.sh

Tips

  • Choose a known-good commit as far back as practical to reduce iterations.
  • The number of steps is approximately log2(N) where N is the number of commits in the range.
  • If a commit cannot be tested (e.g., broken build), skip it: git bisect skip.

10. History Management

Squash Merge

Combine all feature branch commits into a single commit. Ideal for branches with many WIP commits.

git checkout develop
git merge --squash feature/123-add-login
git commit -m "feat(auth): Add login feature"

Fixup Commits

Create a commit intended to be squashed into a previous commit during rebase:

git commit --fixup=<target-hash>
git rebase -i --autosquash HEAD~5    # autosquash fixup commits

Tip: enable autosquash by default with git config --global rebase.autosquash true.

Amend

Modify the most recent commit (message or content). Only use on unpushed commits.

git commit --amend -m "fix(auth): Correct token expiry check"  # change message
git add forgotten-file.ts && git commit --amend --no-edit       # add missed files

When to Use Each

TechniqueScenario
Squash mergeMerging a feature branch with noisy history
FixupAddressing review feedback before merge
AmendFixing typos or adding missed files in latest commit
RewordCorrecting a misleading commit message

11. Pull Request Workflow

PR Size Guidelines

SizeLines ChangedRecommendation
Small< 200Ideal
Medium200–400Acceptable
Large400–800Consider splitting
Extra large> 800Split into smaller PRs

Splitting Large PRs

  • Separate refactoring from feature work; split backend/frontend when possible.
  • Use stacked PRs: PR1 (base) → PR2 (builds on PR1) → PR3.

Draft PRs

Use draft PRs for work-in-progress needing early feedback, dependent changes, or experimental spikes. Convert to ready when all checks pass and the work is complete.

gh pr create --draft --title "feat(auth): Add OAuth2 flow" --body "WIP: seeking feedback"

Reviewer Assignment

  • Assign at least one reviewer with domain knowledge of the changed area.
  • For cross-cutting changes, assign reviewers from each affected team.
  • Use .github/CODEOWNERS to automate reviewer assignment per directory.

Review Etiquette

  • Reviewers: provide actionable feedback; distinguish between blocking issues and suggestions.
  • Authors: respond to all comments before merging; do not dismiss reviews without discussion.
  • Use conventional comment prefixes: nit:, suggestion:, question:, blocker:.

Keep looking

Skills are one crate of 328,083. Ordering is by how many stacks a row turns up in, so the top of any crate is what has actually been picked rather than what has the most stars.