summaryrefslogtreecommitdiffstats
path: root/docs/policies/GIT-WORKFLOW-QUICK-REF.md
blob: c79d62b87d3c284e7e38d1d835ba94ff15f788fb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
# Git Workflow Quick Reference

## Three Branches

| Branch | Purpose | Deploy |
|--------|---------|--------|
| `feature/*`, `week-*` | Development | No |
| `master` | Staging/dev | No |
| `production` | Live | **Yes** |

## Create Feature Branch (Optional)

```bash
git checkout -b feature/my-feature
# or: git checkout -b week-5-forms
git branch -v
```

## During Development

```bash
# Check status
git status

# See what changed
git diff

# Stage and commit
git add <files>
git commit -m "feat: add component"

# Rebuild CSS if changed templates
npm run build

# Test
hugo server
```

## Review Changes

```bash
# View recent commits
git log --oneline -10

# View all changes since master
git diff master..feature/my-feature

# View changes summary
git diff --stat master..feature/my-feature
```

## Merge to Master (Staging)

```bash
git checkout master
git pull origin master
git merge feature/my-feature
git branch -d feature/my-feature  # optional
git push origin master
```

## Deploy to Production (LIVE)

```bash
git checkout production
git pull origin production
git merge master
git push origin production
# ← This triggers the live rebuild
```

## Common Commands

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

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

# Switch branches
git checkout master
git checkout feature/my-feature

# Rebase feature branch on latest master (optional)
git checkout feature/my-feature
git rebase master
```

## Commit Message Template

```
feat: add contact form component

- Form validation
- Dark/light mode support
- WCAG AA accessibility
```

## Key Points

✅ Feature branch or quick master commits  
✅ Commit regularly after logical units  
✅ Clear commit messages  
✅ Test in browser before merging  
✅ Merge feature → master (staging)  
✅ Merge master → production (LIVE DEPLOY)  

## For Full Details

See `GIT-WORKFLOW.md` for comprehensive documentation.