- When user downloaded course materials as ZIP (Module 025), they have no Git history or connection to remote.
- After learning Git basics (Module 060), they may want to receive course updates via
git pullinstead of re-downloading ZIP. - This workflow connects local course folder to GitHub repository while preserving user's work in
work/folder. - Work folder is protected by .gitignore in repository, so it won't be affected by Git operations.
- Create backup before any Git operations for safety.
- User completed Module 025 (downloaded course as ZIP) and Module 060 (learned Git basics).
- User wants automatic updates instead of manual ZIP re-downloads.
- User has exercises/projects in
work/folder they want to preserve. - User understands basic Git commands and is comfortable with terminal.
- Course materials exist in
c:/workspace/hello-genai/(Windows) or~/workspace/hello-genai/(macOS/Linux). - Git installed and configured (
git --versionandgit config --global user.namework). - User completed Git training and understands
git init,git remote,git fetch,git reset. - Terminal/command line access available in IDE.
- Always create timestamped backup before Git operations for safety.
- Store backup outside project folder so it's not affected by Git.
- Windows PowerShell command:
cd c:/workspace/ $timestamp = Get-Date -Format "yyyyMMdd-HHmmss" Compress-Archive -Path "hello-genai" -DestinationPath "hello-genai-backup-$timestamp.zip"
- macOS/Linux command:
cd ~/workspace/ timestamp=$(date +%Y%m%d-%H%M%S) zip -r "hello-genai-backup-$timestamp.zip" hello-genai
- Verify backup exists before proceeding with Git operations.
- Navigate to course folder:
cd c:/workspace/hello-genai/(Windows) orcd ~/workspace/hello-genai/(macOS/Linux). - Remove existing
.gitfolder if present (from previous experiments):- Windows:
if (Test-Path .git) { Remove-Item -Recurse -Force .git } - macOS/Linux:
if [ -d .git ]; then rm -rf .git; fi
- Windows:
- Initialize fresh Git repository:
git init. - Connect to course repository:
git remote add origin https://github.com/codenjoyme/vibecoding-training. - Download repository history:
git fetch origin. - Sync local files with remote:
git reset --hard origin/main. - User's
work/folder remains intact because it's in repository's .gitignore.
- Check remote connection:
git remote -vshould showorigin https://github.com/codenjoyme/vibecoding-training. - Check current branch:
git branchshould show* mainor* master. - Verify work folder exists:
ls work/should list user's exercise files. - View commit history:
git log --oneline -5should show official repository commits. - Test pull command:
git pull origin mainshould respond "Already up to date". - Check status:
git statusshould show "nothing to commit, working tree clean". - Confirm work folder ignored:
git status work/should show no tracked files.
- User can now pull course updates:
git pull origin main. - Run pull before starting each learning session to get latest materials.
- Work folder is always safe during pulls (protected by .gitignore).
- If local modifications to course files exist,
git statuswill show them. - Usually should discard local changes to course files before pulling:
git checkout -- filename. - Never commit/push to course repository unless user wants to contribute.
- If backup fails: check disk space, write permissions, correct directory.
- If "fatal: not a git repository": ensure in correct directory with
pwdorcd. - If "fatal: remote origin already exists": remove with
git remote remove origin, then add again. - If
git reset --hardfails: ensuregit fetch originran successfully first. - If work folder disappeared: restore from backup ZIP, check .gitignore contains
work/. - If download very slow: repository is ~5-10 MB, should take 30-60 seconds; check internet.
- If pull asks for credentials: HTTPS should work read-only; use GitHub username/token if needed.
- If something goes wrong, delete course folder and extract backup.
- Windows:
Remove-Item -Recurse -Force c:/workspace/hello-genai/then extract ZIP. - macOS/Linux:
rm -rf ~/workspace/hello-genai/thenunzip hello-genai-backup-TIMESTAMP.zip. - User returns to pre-connection state and can try again or continue with ZIP-based updates.
- Instead of this workflow, user can continue downloading updated ZIP files from GitHub.
- Manual approach: download new ZIP, extract, manually copy their
work/folder over. - Git approach is cleaner for regular updates but adds complexity.
- This workflow is optional - both approaches (Git and manual ZIP) are valid.