Git Version Control

Git tracks every change you make to the template so you can experiment freely, roll back mistakes, and push to Vercel with confidence. If you bought Lifetime Access, you get direct GitHub repo access. Pull future template updates with a single command.

Last updated: 2026-03-29

First-Time Setup

If you have Lifetime Access, clone the Flux repo directly. If you bought an individual theme, unzip the download from your Polar.sh library and initialise git yourself.

Terminal
# — Lifetime Access (GitHub repo) —
git clone https://github.com/flux-template-org/saas-template.git
cd saas-template
npm install
cp .env.example .env   # then fill in your keys
npm run dev

# — Individual theme (zip download) —
unzip flux-theme.zip
cd flux-theme
git init
git add .
git commit -m "chore: initial Flux Theme setup"
npm install
cp .env.example .env
npm run dev

Branch Workflow for Flux

Keep main always deployable. Create a branch for each customisation. New pages, theme edits, integration wiring. And merge only when it works.

Terminal
# Start a new customisation
git checkout -b feature/custom-hero-section

# Flux-specific commit examples
git add src/components/hero/Hero.jsx
git commit -m "feat(hero): update headline and CTA copy"

git add src/components/data/gallery.json
git commit -m "feat(gallery): add fashion-store template entry"

git add src/styles/global.css
git commit -m "style: switch font to Nord, update CSS variables"

git add src/pages/api/stripe-webhook.js
git commit -m "feat(stripe): wire purchase_completed webhook"

# Push branch → Vercel creates a preview URL automatically
git push origin feature/custom-hero-section

# Merge to main → triggers Vercel production deploy
git checkout main
git merge feature/custom-hero-section
git push origin main

Pulling Template Updates (Lifetime Access)

When a new version of Flux drops, pull upstream changes into your fork. Use a separate branch so you can review what changed before merging into your customised main.

Terminal
# Add the official Flux repo as upstream (once)
git remote add upstream https://github.com/flux-template-org/saas-template.git

# Fetch the latest template changes
git fetch upstream

# Create a branch to review the update
git checkout -b update/flux-v2
git merge upstream/main

# Resolve any conflicts (usually in data/ or global.css)
# Then merge into your main
git checkout main
git merge update/flux-v2
git push origin main

Keep Secrets Out of Git

Flux's .gitignore already excludes .env files. Double-check before your first push. A leaked Stripe or Clerk key means rotating all your keys.

.gitignore
# .gitignore — already in Flux Theme, covers all env variants
.env
.env.local
.env.production
.env.*.local

# Verify nothing secret is staged
git status
# .env must NOT appear in the list

# If you accidentally staged .env, remove it from tracking
git rm --cached .env
git commit -m "chore: remove .env from tracking"