원클릭으로
git-workflow
Git best practices, branch management, and commit discipline for effective version control.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
메뉴
Git best practices, branch management, and commit discipline for effective version control.
Codex 또는 Claude로 설치 이 Prompt를 복사해 Codex, Claude 또는 다른 어시스턴트에 붙여 넣으면 Skill 페이지를 검토하고 설치를 진행할 수 있습니다.
SOC 직업 분류 기준
PersonalOS skill: account-management
API endpoint testing, mocking, and integration testing for robust API development.
Optimize images, icons, and design assets for performance, quality, and developer handoff
Plan, track, and optimize budgets to maximize value and financial performance
CI/CD pipeline optimization, build failures, and deployment automation for DevOps workflows.
Code quality improvement, technical debt reduction, and refactoring patterns for maintainable software.
| name | git-workflow |
| description | Git best practices, branch management, and commit discipline for effective version control. |
Git best practices, branch management strategies, and commit discipline for effective version control.
Guides you through Git best practices including branch management, commit discipline, and collaboration workflows.
Git Flow (Classic):
main (production)
↑
develop (development)
↑
feature/* (features)
↑
hotfix/* (emergency fixes)
release/* (release preparation)
GitHub Flow (Simple):
main (production)
↑
feature/* (features)
Trunk-Based Development:
main (everything)
↑
Short-lived feature branches (merge quickly)
Create Feature Branch:
# Start from develop or main
git checkout develop
git pull
# Create feature branch
git checkout -b feature/user-authentication
# Work on feature
# Make commits...
# Push to remote
git push -u origin feature/user-authentication
Commit Discipline:
# Stage changes
git add path/to/file.py
# Commit with clear message
git commit -m "feat: add user authentication endpoint"
# Multiple files
git add src/auth/
git commit -m "feat: implement OAuth2 flow"
# Amend commit (before pushing)
git commit --amend -m "feat: add user authentication with OAuth2"
Create Pull Request:
PR Description Template:
## Description
Brief description of changes
## Type of Change
- [ ] Bug fix
- [ ] New feature
- [ ] Breaking change
- [ ] Documentation update
## Testing
- [ ] Unit tests pass
- [ ] Integration tests pass
- [ ] Manual testing completed
## Checklist
- [ ] Code follows style guidelines
- [ ] Self-review completed
- [ ] Comments added for complex code
- [ ] Documentation updated
- [ ] No new warnings
Merge vs Rebase:
# Merge (preserves history)
git checkout main
git merge feature/user-authentication
# Rebase (linear history)
git checkout feature/user-authentication
git rebase main
# Interactive rebase (clean up commits)
git rebase -i HEAD~3
Resolve Conflicts:
# During merge/rebase, conflicts occur
# Git marks conflicts with <<<<<<<, =======, >>>>>>>
# Open file and resolve conflicts
vim src/auth.py
# Mark as resolved
git add src/auth.py
# Continue merge/rebase
git merge --continue
# or
git rebase --continue
Commit Message Format:
<type>(<scope>): <subject>
<body>
<footer>
Types:
feat: New featurefix: Bug fixdocs: Documentationstyle: Code style (formatting)refactor: Code refactoringtest: Testschore: Maintenanceperf: Performance improvementci: CI/CD changesExamples:
feat(auth): add OAuth2 authentication flow
Implement OAuth2 with support for Google and GitHub providers.
Closes #123
fix(auth): resolve token refresh issue
Token refresh was failing due to incorrect timestamp comparison.
Fixes #456
Tagging:
# Tag release
git tag -a v1.0.0 -m "Release v1.0.0"
# Push tags
git push origin v1.0.0
git push origin --tags
# List tags
git tag
# Show tag details
git show v1.0.0
Clean Up History:
# Interactive rebase last 5 commits
git rebase -i HEAD~5
# Commands:
# pick = use commit
# reword = edit commit message
# edit = pause for changes
# squash = merge into previous commit
# fixup = merge into previous (no message)
# drop = remove commit
Pre-Commit Hook:
#!/bin/bash
# .git/hooks/pre-commit
# Run linter
npm run lint
if [ $? -ne 0 ]; then
echo "Linting failed"
exit 1
fi
# Run tests
npm test
if [ $? -ne 0 ]; then
echo "Tests failed"
exit 1
fi
Commit Message Hook:
#!/bin/bash
# .git/hooks/commit-msg
# Validate commit message format
if ! grep -qE '^(feat|fix|docs|style|refactor|test|chore|perf|ci)(\(.+\))?: .+' "$1"; then
echo "Invalid commit message format"
echo "Use: type(scope): subject"
exit 1
fi
Useful Aliases:
git config --global alias.co checkout
git config --global alias.br branch
git config --global alias.ci commit
git config --global alias.st status
git config --global alias.lg "log --graph --oneline --all"
git config --global alias.last "log -1 HEAD"
git config --global alias.unstage "reset HEAD --"
git config --global alias Amend "commit --amend --no-edit"
Binary Search History:
# Start bisect
git bisect start
# Mark current commit as bad
git bisect bad
# Mark known good commit
git bisect good v1.0.0
# Git will checkout middle commit
# Test and mark good or bad
git bisect good
# or
git bisect bad
# Continue until bug is found
# Reset to original state
git bisect reset
Pre-Merge Checks:
# .github/workflows/quality-gate.yml
name: Quality Gate
on: [pull_request]
jobs:
quality:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Lint
run: npm run lint
- name: Test
run: npm test
- name: Security Scan
run: npm audit
- name: Build
run: npm run build
Track Repository Health:
def analyze_repository_health(repo_path):
"""Analyze git repository health metrics"""
metrics = {
'commit_frequency': calculate_commit_frequency(repo_path),
'branch_divergence': calculate_branch_divergence(repo_path),
'merge_conflicts': count_merge_conflicts(repo_path),
'code_review_time': calculate_review_time(repo_path),
'deployment_frequency': calculate_deployment_frequency(repo_path)
}
return metrics
Do:
Don't: