Managing git skill

Manages Git workflows including branching, commits, and pull requests.

by CloudAI-X·MIT license·★ 1,416 Stars on the repo·GitHub ↗

Use now

Files of Managing git

CloudAI-X/main1 file shown
SKILL.md
Show the full text230 lines

Managing Git

When to Load
  • Trigger: Branching strategies, commit workflows, pull requests, merge conflicts, version control questions
  • Skip: Tasks that do not involve git operations

Feature Development Workflow

Copy this checklist and track progress:

Feature Development Progress:
- [ ] Step 1: Create feature branch from main
- [ ] Step 2: Make changes with atomic commits
- [ ] Step 3: Rebase on latest main
- [ ] Step 4: Push and create PR
- [ ] Step 5: Address review feedback
- [ ] Step 6: Merge after approval

Branching Strategies

main ──●────●────●────●────●── (always deployable)
        \          /
feature  └──●──●──┘
  • main is always deployable
  • Feature branches from main
  • PR + review + merge
  • Deploy after merge
Git Flow (For release-based projects)
main     ──●─────────────●────── (releases only)
            \           /
release      └────●────┘
                 /
develop  ──●──●────●──●──●──
            \     /
feature      └──●┘

Commit Conventions

Conventional Commits Format
<type>(<scope>): <description>

[optional body]

[optional footer(s)]
Types
Type Description
feat New feature
fix Bug fix
docs Documentation only
style Formatting, no logic change
refactor Code change that neither fixes bug nor adds feature
perf Performance improvement
test Adding/updating tests
chore Build process, dependencies
ci CI configuration
Examples
feat(auth): add OAuth2 login support

Implements Google and GitHub OAuth providers.
Closes #123

BREAKING CHANGE: Session tokens now expire after 24h
fix(api): handle null response from payment gateway

Previously caused 500 error when gateway returned null.
Now returns appropriate error message to user.

Branch Naming

<type>/<ticket-id>-<short-description>

# Examples
feature/AUTH-123-oauth-login
fix/BUG-456-null-pointer
chore/TECH-789-upgrade-deps

Pull Request Workflow

Copy this checklist when creating PRs:

PR Checklist:
- [ ] Code follows project conventions
- [ ] Tests added/updated for changes
- [ ] All tests pass locally
- [ ] No merge conflicts with main
- [ ] Documentation updated if needed
- [ ] No security vulnerabilities introduced
- [ ] PR description explains the "why"
PR Template
## Summary

[Brief description of changes]

## Changes

- [Change 1]
- [Change 2]

## Testing

- [ ] Unit tests added/updated
- [ ] Manual testing performed
- [ ] E2E tests pass

## Screenshots (if UI changes)

[Before/After screenshots]
PR Size Guidelines
Size Lines Changed Review Guidance
XS < 50 Quick review
S 50-200 Standard review
M 200-500 Thorough review
L 500+ Split if possible

Common Git Commands

Daily Workflow
# Start new feature
git checkout main
git pull
git checkout -b feature/TICKET-123-description

# Commit changes
git add path/to/file  # Stage specific files (git add -p needs an interactive terminal)
git commit -m "feat: description"

# Keep up with main
git fetch origin main
git rebase origin/main

# Push and create PR
git push -u origin HEAD  # after rebasing an already-pushed branch: git push --force-with-lease
Fixing Mistakes
# Amend last commit (before push)
git commit --amend

# Undo last commit (keep changes)
git reset --soft HEAD~1

# Undo last commit (discard changes)
git reset --hard HEAD~1  # also discards uncommitted changes

# Revert a pushed commit
git revert <commit-hash>

# Interactive rebase to clean up
git rebase -i HEAD~3
# Non-interactive: git commit --fixup=<sha>, then
GIT_SEQUENCE_EDITOR=: git rebase -i --autosquash HEAD~3
Advanced Operations
# Cherry-pick specific commit
git cherry-pick <commit-hash>

# Find which commit broke something
git bisect start
git bisect bad HEAD
git bisect good <known-good-commit>

# Stash with message
git stash push -m "WIP: feature description"
git stash list
git stash pop

Commit Validation

Before pushing, validate commits:

Commit Validation:
- [ ] Each commit has a clear, descriptive message
- [ ] Commit type matches the change (feat, fix, etc.)
- [ ] No WIP or temporary commits
- [ ] No secrets or credentials committed
- [ ] Changes are atomic (one logical change per commit)

If validation fails, use git rebase -i to clean up commit history (or --fixup + --autosquash when no interactive terminal is available) before pushing.

1---
2name: managing-git
3description: Manages Git workflows including branching, commits, and pull requests. Use when working with Git, creating commits, opening PRs, managing branches, resolving conflicts, or when asked about version control best practices.
4---
5 
6# Managing Git
7 
8### When to Load
9 
10- **Trigger**: Branching strategies, commit workflows, pull requests, merge conflicts, version control questions
11- **Skip**: Tasks that do not involve git operations
12 
13## Feature Development Workflow
14 
15Copy this checklist and track progress:
16 
17```
18Feature Development Progress:
19- [ ] Step 1: Create feature branch from main
20- [ ] Step 2: Make changes with atomic commits
21- [ ] Step 3: Rebase on latest main
22- [ ] Step 4: Push and create PR
23- [ ] Step 5: Address review feedback
24- [ ] Step 6: Merge after approval
25```
26 
27## Branching Strategies
28 
29### GitHub Flow (Recommended for most projects)
30 
31```
32main ──●────●────●────●────●── (always deployable)
33 \ /
34feature └──●──●──┘
35```
36 
37- `main` is always deployable
38- Feature branches from main
39- PR + review + merge
40- Deploy after merge
41 
42### Git Flow (For release-based projects)
43 
44```
45main ──●─────────────●────── (releases only)
46 \ /
47release └────●────┘
48 /
49develop ──●──●────●──●──●──
50 \ /
51feature └──●┘
52```
53 
54## Commit Conventions
55 
56### Conventional Commits Format
57 
58```
59<type>(<scope>): <description>
60 
61[optional body]
62 
63[optional footer(s)]
64```
65 
66### Types
67 
68| Type | Description |
69| ---------- | --------------------------------------------------- |
70| `feat` | New feature |
71| `fix` | Bug fix |
72| `docs` | Documentation only |
73| `style` | Formatting, no logic change |
74| `refactor` | Code change that neither fixes bug nor adds feature |
75| `perf` | Performance improvement |
76| `test` | Adding/updating tests |
77| `chore` | Build process, dependencies |
78| `ci` | CI configuration |
79 
80### Examples
81 
82```bash
83feat(auth): add OAuth2 login support
84 
85Implements Google and GitHub OAuth providers.
86Closes #123
87 
88BREAKING CHANGE: Session tokens now expire after 24h
89```
90 
91```bash
92fix(api): handle null response from payment gateway
93 
94Previously caused 500 error when gateway returned null.
95Now returns appropriate error message to user.
96```
97 
98## Branch Naming
99 
100```
101<type>/<ticket-id>-<short-description>
102 
103# Examples
104feature/AUTH-123-oauth-login
105fix/BUG-456-null-pointer
106chore/TECH-789-upgrade-deps
107```
108 
109## Pull Request Workflow
110 
111Copy this checklist when creating PRs:
112 
113```
114PR Checklist:
115- [ ] Code follows project conventions
116- [ ] Tests added/updated for changes
117- [ ] All tests pass locally
118- [ ] No merge conflicts with main
119- [ ] Documentation updated if needed
120- [ ] No security vulnerabilities introduced
121- [ ] PR description explains the "why"
122```
123 
124### PR Template
125 
126```markdown
127## Summary
128 
129[Brief description of changes]
130 
131## Changes
132 
133- [Change 1]
134- [Change 2]
135 
136## Testing
137 
138- [ ] Unit tests added/updated
139- [ ] Manual testing performed
140- [ ] E2E tests pass
141 
142## Screenshots (if UI changes)
143 
144[Before/After screenshots]
145```
146 
147### PR Size Guidelines
148 
149| Size | Lines Changed | Review Guidance |
150| ---- | ------------- | ----------------- |
151| XS | < 50 | Quick review |
152| S | 50-200 | Standard review |
153| M | 200-500 | Thorough review |
154| L | 500+ | Split if possible |
155 
156## Common Git Commands
157 
158### Daily Workflow
159 
160```bash
161# Start new feature
162git checkout main
163git pull
164git checkout -b feature/TICKET-123-description
165 
166# Commit changes
167git add path/to/file # Stage specific files (git add -p needs an interactive terminal)
168git commit -m "feat: description"
169 
170# Keep up with main
171git fetch origin main
172git rebase origin/main
173 
174# Push and create PR
175git push -u origin HEAD # after rebasing an already-pushed branch: git push --force-with-lease
176```
177 
178### Fixing Mistakes
179 
180```bash
181# Amend last commit (before push)
182git commit --amend
183 
184# Undo last commit (keep changes)
185git reset --soft HEAD~1
186 
187# Undo last commit (discard changes)
188git reset --hard HEAD~1 # also discards uncommitted changes
189 
190# Revert a pushed commit
191git revert <commit-hash>
192 
193# Interactive rebase to clean up
194git rebase -i HEAD~3
195# Non-interactive: git commit --fixup=<sha>, then
196GIT_SEQUENCE_EDITOR=: git rebase -i --autosquash HEAD~3
197```
198 
199### Advanced Operations
200 
201```bash
202# Cherry-pick specific commit
203git cherry-pick <commit-hash>
204 
205# Find which commit broke something
206git bisect start
207git bisect bad HEAD
208git bisect good <known-good-commit>
209 
210# Stash with message
211git stash push -m "WIP: feature description"
212git stash list
213git stash pop
214```
215 
216## Commit Validation
217 
218Before pushing, validate commits:
219 
220```
221Commit Validation:
222- [ ] Each commit has a clear, descriptive message
223- [ ] Commit type matches the change (feat, fix, etc.)
224- [ ] No WIP or temporary commits
225- [ ] No secrets or credentials committed
226- [ ] Changes are atomic (one logical change per commit)
227```
228 
229If validation fails, use `git rebase -i` to clean up commit history (or `--fixup` + `--autosquash` when no interactive terminal is available) before pushing.
230 

Discussion

Alternatives

CI/CD and AutomationAutomates CI/CD pipeline setup. Use when setting up or modifying build and deployment pipelines. Use when you need to automate quality gates, configure test runners in CI, or establish deployment strategies.Infrastructure & ops · MITVersion Bump & Release WorkflowAutomated semantic versioning and release workflow for Claude Code plugins. Handles version increments across package.json, marketplace.json, plugin.json manifests, build verification, git tagging, GitHub releases, and changelog generation. NPM publishing is the final human-required handoff because the maintainer raised npm security.Infrastructure & ops · Apache-2.0Orca CLIOperate Orca-managed worktrees, folder contexts, terminals, repos, automations, artifacts, skill sharing, worktree comments, and Orca's embedded browser through the `orca` CLI. Use when the user says "$orca-cli", "Orca worktree", "child worktree", "spawn codex/claude in a worktree", "read/wait/send Orca terminal", "handoff" / "handover" / "give this to another agent", "Orca browser", "orca artifacts", or "share skills". Prefer it over raw git worktree, ad hoc PTYs, or Computer Use when Orca state is involved. Use Computer Use only when a visible window needs GUI control that a CLI, filesystem, or API cannot do.Infrastructure & ops · MITOrca OrchestrationCoordinate supervised Orca workers: threaded messages, blocking ask/reply, task dispatch, worker_done/escalation waits, task DAGs, decision gates, coordinator loops, and decomposing work across agents. Use `orca-cli` for full ownership handoffs — "hand off", "handoff", "handover", "give this to another agent", "another worktree" — unless asked to supervise, monitor, or coordinate a DAG, and for terminal control, lightweight terminal prompts, shell commands, Orca worktree management, and reading or waiting on terminals.Infrastructure & ops · MIT