2.7 KiB
2.7 KiB
Git Setup Guide
Pushing Your Project to Git
Initial Setup
-
Initialize Git (if not already done):
git init -
Add a Remote (replace with your repository URL):
git remote add origin https://github.com/yourusername/yourrepo.git -
Create Initial Commit:
git add . git commit -m "Initial commit: Virtual Business Card" -
Push to Remote:
git push -u origin main
Local Configuration Safety
✅ What Gets Pushed to Git:
- Default business card config:
src/config/businessCard.config.ts - All source code and components
- Configuration and build files
- Documentation
❌ What Stays Local (Never Pushed):
- Your personal business card config:
src/config/businessCard.config.local.ts - Node modules:
node_modules/ - Build output:
dist/ - Other files matching
*.localpattern
How .gitignore Protects Your Data
The .gitignore file already includes:
*.local
This means any file ending with .local is automatically excluded from git. Your personal business card configuration in businessCard.config.local.ts will never be tracked or pushed.
Workflow for Sharing the Project
For You (Developer)
- Create
src/config/businessCard.config.local.tswith your personal info - Make changes to your local config as needed
- Push code changes to git (your personal config stays local)
For Others Using Your Repository
- Clone the repository
- Copy
src/config/businessCard.config.local.example.tstosrc/config/businessCard.config.local.ts - Edit the local config with their own information
- Run
npm install --legacy-peer-deps && npm run dev - Their changes to
businessCard.config.local.tsstay local
Checking Git Status
To verify your personal config is being ignored:
git status
You should NOT see src/config/businessCard.config.local.ts in the output. If you do, your .gitignore may need adjustment.
To also check git tracking:
git check-ignore src/config/businessCard.config.local.ts
This should print the file path if it's properly ignored.
Example Git Commands
# Check what will be committed
git status
# Add all non-ignored files
git add .
# Commit changes
git commit -m "Update business card styles"
# Push to remote
git push
# View git history
git log
# See what files are being tracked
git ls-files
Important Notes
- Always ensure
businessCard.config.local.tsis in.gitignorebefore pushing - Never commit personal business card data
- The example file
businessCard.config.local.example.tsCAN be committed to help others - Each user/clone should have their own local config file