gc-guide/src/content/GitWorkflow.tsx
htlee 56ed0bd270 refactor(content): Gitea 사용법/Git 워크플로우 가이드 스킬 기반 재구성
- GitWorkflow: Conventional Commits에 /push 자동 생성 Alert 추가
- GitWorkflow: 일반 작업 흐름을 스킬 기반(권장)/수동 워크플로우로 분리
- GiteaUsage: 이슈 관리에 /fix-issue 스킬 권장 추가
- GiteaUsage: MR 섹션을 'MR 확인 및 리뷰'로 리뷰 관점 재작성

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-03-01 18:44:52 +09:00

241 lines
13 KiB
TypeScript

import { Alert } from '../components/common/Alert';
import { CodeBlock } from '../components/common/CodeBlock';
import { StepGuide } from '../components/common/StepGuide';
export default function GitWorkflow() {
return (
<div className="max-w-4xl mx-auto py-12 px-6">
<h1 className="text-3xl font-bold text-text-primary mb-2">Git </h1>
<p className="text-text-secondary mb-8">
, , 3 .
</p>
{/* 브랜치 전략 */}
<h2 className="text-xl font-bold text-text-primary mt-10 mb-4"> </h2>
<div className="bg-surface border border-border-default rounded-xl p-6 mb-6">
<div className="font-mono text-sm space-y-2">
<div className="flex items-center gap-3">
<span className="inline-block w-24 px-2 py-1 bg-danger/10 text-danger rounded text-center font-semibold">main</span>
<span className="text-text-secondary"> ()</span>
</div>
<div className="flex items-center gap-3 pl-6">
<span className="text-text-muted"></span>
<span className="inline-block w-24 px-2 py-1 bg-info/10 text-info rounded text-center font-semibold">develop</span>
<span className="text-text-secondary"> </span>
</div>
<div className="flex items-center gap-3 pl-16">
<span className="text-text-muted"></span>
<span className="text-success">feature/ISSUE-123-</span>
</div>
<div className="flex items-center gap-3 pl-16">
<span className="text-text-muted"></span>
<span className="text-warning">bugfix/ISSUE-456-</span>
</div>
<div className="flex items-center gap-3 pl-16">
<span className="text-text-muted"></span>
<span className="text-danger">hotfix/ISSUE-789-</span>
</div>
</div>
</div>
<Alert type="warning">
<code className="bg-bg-tertiary px-1 rounded">main</code> / . MR을 .{' '}
<code className="bg-bg-tertiary px-1 rounded">develop</code> push pre-receive hook .
</Alert>
{/* 브랜치 네이밍 */}
<h2 className="text-xl font-bold text-text-primary mt-10 mb-4"> </h2>
<div className="overflow-x-auto">
<table className="w-full bg-surface border border-border-default rounded-lg overflow-hidden text-sm">
<thead>
<tr className="bg-bg-tertiary">
<th className="text-left px-4 py-3 font-semibold text-text-primary"></th>
<th className="text-left px-4 py-3 font-semibold text-text-primary"></th>
<th className="text-left px-4 py-3 font-semibold text-text-primary"></th>
</tr>
</thead>
<tbody className="divide-y divide-border-subtle">
<tr>
<td className="px-4 py-3 text-text-primary"></td>
<td className="px-4 py-3 font-mono text-sm text-text-secondary">feature/ISSUE--</td>
<td className="px-4 py-3 font-mono text-sm text-accent">feature/ISSUE-42-user-login</td>
</tr>
<tr>
<td className="px-4 py-3 text-text-primary"></td>
<td className="px-4 py-3 font-mono text-sm text-text-secondary">bugfix/ISSUE--</td>
<td className="px-4 py-3 font-mono text-sm text-accent">bugfix/ISSUE-56-date-format</td>
</tr>
<tr>
<td className="px-4 py-3 text-text-primary"></td>
<td className="px-4 py-3 font-mono text-sm text-text-secondary">hotfix/ISSUE--</td>
<td className="px-4 py-3 font-mono text-sm text-accent">hotfix/ISSUE-99-api-timeout</td>
</tr>
</tbody>
</table>
</div>
{/* Conventional Commits */}
<h2 className="text-xl font-bold text-text-primary mt-10 mb-4">Conventional Commits</h2>
<p className="text-text-secondary mb-4">
.
</p>
<CodeBlock
language="text"
code={`type(scope): subject
body (선택)
footer (선택)`}
/>
<div className="overflow-x-auto mt-4">
<table className="w-full bg-surface border border-border-default rounded-lg overflow-hidden text-sm">
<thead>
<tr className="bg-bg-tertiary">
<th className="text-left px-4 py-3 font-semibold text-text-primary">type</th>
<th className="text-left px-4 py-3 font-semibold text-text-primary"></th>
<th className="text-left px-4 py-3 font-semibold text-text-primary"></th>
</tr>
</thead>
<tbody className="divide-y divide-border-subtle">
{[
{ type: 'feat', desc: '새로운 기능 추가', ex: 'feat(auth): JWT 기반 로그인 구현' },
{ type: 'fix', desc: '버그 수정', ex: 'fix(배치): 야간 배치 타임아웃 수정' },
{ type: 'refactor', desc: '리팩토링', ex: 'refactor(user): 중복 로직 추출' },
{ type: 'docs', desc: '문서 변경', ex: 'docs: README에 빌드 방법 추가' },
{ type: 'test', desc: '테스트 추가/수정', ex: 'test(결제): 환불 로직 단위 테스트' },
{ type: 'chore', desc: '빌드, 설정 변경', ex: 'chore: Gradle 의존성 업데이트' },
].map((row) => (
<tr key={row.type}>
<td className="px-4 py-3 font-mono text-accent font-medium">{row.type}</td>
<td className="px-4 py-3 text-text-secondary">{row.desc}</td>
<td className="px-4 py-3 font-mono text-xs text-text-muted">{row.ex}</td>
</tr>
))}
</tbody>
</table>
</div>
<Alert type="info">
<code className="bg-bg-tertiary px-1 rounded">/push</code> .
. <code className="bg-bg-tertiary px-1 rounded">commit-msg</code> hook이 .
</Alert>
{/* 작업 흐름 */}
<h2 className="text-xl font-bold text-text-primary mt-10 mb-4"> </h2>
<h3 className="text-lg font-semibold text-text-primary mt-6 mb-3"> ()</h3>
<p className="text-text-secondary mb-4">
Claude Code의 MR .
</p>
<StepGuide
steps={[
{
title: '이슈 확인 및 브랜치 생성',
content: (
<>
<CodeBlock language="text" code="/fix-issue 42" />
<p className="text-sm text-text-muted mt-2">
<code className="bg-bg-tertiary px-1 rounded">feature/ISSUE-42-</code> .
</p>
</>
),
},
{
title: '개발 및 중간 푸시',
content: (
<>
<CodeBlock language="text" code="/push" />
<p className="text-sm text-text-muted mt-2">
Conventional Commits .
</p>
</>
),
},
{
title: 'MR 생성',
content: (
<>
<CodeBlock language="text" code="/mr" />
<p className="text-sm text-text-muted mt-2">
+ + MR + .
/ .
</p>
</>
),
},
{
title: '리뷰 후 머지',
content: (
<p>
1 <strong>Squash Merge</strong> .{' '}
<code className="bg-bg-tertiary px-1 rounded">/mr</code> + .
</p>
),
},
]}
/>
<h3 className="text-lg font-semibold text-text-primary mt-8 mb-3"> </h3>
<p className="text-text-secondary mb-4">
Claude Code git .
</p>
<div className="bg-surface border border-border-default rounded-xl p-6 space-y-4">
<div className="flex items-start gap-3">
<span className="flex-shrink-0 w-6 h-6 bg-accent/10 text-accent rounded-full flex items-center justify-center text-sm font-semibold">1</span>
<div>
<p className="font-medium text-text-primary"> </p>
<CodeBlock language="bash" code={`git checkout develop && git pull origin develop\ngit checkout -b feature/ISSUE-42-user-login`} />
</div>
</div>
<div className="flex items-start gap-3">
<span className="flex-shrink-0 w-6 h-6 bg-accent/10 text-accent rounded-full flex items-center justify-center text-sm font-semibold">2</span>
<div>
<p className="font-medium text-text-primary"></p>
<CodeBlock language="bash" code={`git add src/auth/LoginForm.tsx\ngit commit -m "feat(auth): 로그인 폼 UI 구현 (#42)"`} />
</div>
</div>
<div className="flex items-start gap-3">
<span className="flex-shrink-0 w-6 h-6 bg-accent/10 text-accent rounded-full flex items-center justify-center text-sm font-semibold">3</span>
<div>
<p className="font-medium text-text-primary"> MR </p>
<CodeBlock language="bash" code={`git push -u origin feature/ISSUE-42-user-login\n# Gitea 웹 UI → 새 Pull Request → develop ← feature 브랜치`} />
</div>
</div>
<div className="flex items-start gap-3">
<span className="flex-shrink-0 w-6 h-6 bg-accent/10 text-accent rounded-full flex items-center justify-center text-sm font-semibold">4</span>
<div>
<p className="font-medium text-text-primary"> </p>
<p className="text-sm text-text-secondary"> 1 Squash Merge </p>
</div>
</div>
</div>
{/* 3계층 보호 정책 */}
<h2 className="text-xl font-bold text-text-primary mt-10 mb-4">3 </h2>
<div className="space-y-3">
<div className="bg-surface border border-border-default rounded-lg p-4">
<h4 className="font-semibold text-danger mb-1">1. Git Hooks ()</h4>
<p className="text-sm text-text-secondary">
<code className="bg-bg-tertiary px-1 rounded">commit-msg</code> . Conventional Commits .
</p>
</div>
<div className="bg-surface border border-border-default rounded-lg p-4">
<h4 className="font-semibold text-warning mb-1">2. Pre-receive Hook</h4>
<p className="text-sm text-text-secondary">
Push <code className="bg-bg-tertiary px-1 rounded">pre-receive hook</code> .{' '}
<code className="bg-bg-tertiary px-1 rounded">main</code>/<code className="bg-bg-tertiary px-1 rounded">develop</code> push ,
, (credentials, .env ) , force push .
</p>
</div>
<div className="bg-surface border border-border-default rounded-lg p-4">
<h4 className="font-semibold text-success mb-1">3. </h4>
<p className="text-sm text-text-secondary">
<code className="bg-bg-tertiary px-1 rounded">main</code> MR을 , 1 .{' '}
<code className="bg-bg-tertiary px-1 rounded">develop</code> push가 , pre-receive hook .
</p>
</div>
</div>
</div>
);
}