* text=autoOptional: local “remote” for extra safety
Create a bare repo on the same machine or another drive and push to it like a remote:
# Create a bare backup repomkdir -p D:/git-backups/myproject.git # or /mnt/data/git-backups on Linuxcd D:/git-backups && git init --bare myproject.git# In your working repo:git remote add backup D:/git-backups/myproject.git
You now have origin (optional) and backup (a path remote). You can also point backup to a USB drive or a network share.
2) Daily working loop (VS Code + Git)A. Start of daygit status
git fetch --all # if you use a local bare remote shared by other machines/usersgit switch -c feat/short-description # or 'git switch main' if continuingB. While coding
Keep changes small and focused.
Run tests/linters locally (add VS Code Tasks to automate).
Commit early, commit often with clear messages (Conventional Commits optional):
feat(parser): add FEN validationfix(ui): correct dark theme contrastchore: update dependencies
5) Weekly maintenance (5–10 min)# Update tools/deps, run full test suitegit switch main
git pull --rebase --all # from local remotes if usedgit gc --prune=now --aggressive # tidy up repogit tag -a v0.1.0 -m "Alpha snapshot" # if you hit a milestonegit push backup --tags --all
6) Collaboration without GitHub (optional)
Local file remote on a shared drive: others add backup as their origin.
Project skeleton (top level).vscode/ .gitignore.gitattributesREADME.mdCHANGELOG.mddocs/ scripts/ src/ tests/Extensions: GitLens, Git Graph, Prettier (or Black/ruff for Python), EditorConfig, language linters.
Settings (File → Preferences → Settings → search the keys below):
git.enableSmartCommit: true
git.confirmSync: false
files.trimTrailingWhitespace: true
editor.formatOnSave: true
diffEditor.ignoreTrimWhitespace: true
Workspace .vscode/settings.json (checked into the repo) for formatter/linter choices.
.gitignore (good cross-platform base)
# OS.DS_Store Thumbs.db# Editors.vscode/* !.vscode/settings.json !.vscode/tasks.json !.vscode/extensions.json# Dependencies / buildsnode_modules/ dist/ build/ *.log.gitattributes (line endings consistent)
* text=autoOptional: local “remote” for extra safetyCreate a bare repo on the same machine or another drive and push to it like a remote:
# Create a bare backup repomkdir -p D:/git-backups/myproject.git # or /mnt/data/git-backups on Linuxcd D:/git-backups && git init --bare myproject.git# In your working repo:git remote add backup D:/git-backups/myproject.gitYou now have origin (optional) and backup (a path remote). You can also point backup to a USB drive or a network share.
2) Daily working loop (VS Code + Git)A. Start of daygit status git fetch --all # if you use a local bare remote shared by other machines/usersgit switch -c feat/short-description # or 'git switch main' if continuingB. While coding
git add -p # stage hunks interactivelygit commit -m "feat(parser): add FEN validation"Keep changes small and focused.
Run tests/linters locally (add VS Code Tasks to automate).
Commit early, commit often with clear messages (Conventional Commits optional):
feat(parser): add FEN validationfix(ui): correct dark theme contrastchore: update dependenciesIf you need to pause:
git stash push -u -m "WIP board animations"# ...switch to another task...git stash pop C. Midday or after each task
D. End of day “check-in”Rebase your feature branch on main to keep history clean:
git switch feat/board-anim git fetch --all git rebase mainPush to your local backup:
git push backup HEAD
git add -A git commit -m "chore: EOD checkpoint" || echo "Nothing to commit"Make sure working tree is clean.
git tag -f eod-$(date +%Y-%m-%d) git push backup --tags git push backup --allTag an EOD snapshot (optional but great for rollback):
git bundle create ../myproject-$(date +%Y%m%d).bundle --allCreate a portable bundle archive (air-gap-safe backup):
Copy the bundle to another drive/cloud. You can restore with
git clone myproject-20250817.bundle myproject.
3) Branching & history
main: always green (tests pass).
feat/ branches for features; fix/ for bugfixes; chore/ for maintenance.
Use rebase (not merge) to keep linear history:
git rebase -i mainSquash tiny fixups before integrating:
git commit --fixup <SHA> git rebase -i --autosquash main4) Quality gates (local only)
Pre-commit hooks (no server needed):
Option A: lightweight manual hooks in .git/hooks/ (not versioned by default).
Option B (recommended): pre-commit framework (versioned config).
pip install pre-commit # or use pipx/uv/condapre-commit sample-config > .pre-commit-config.yaml pre-commit installAdd linters/formatters; they’ll run before each commit.
VS Code Tasks to standardize:
{"version": "2.0.0","tasks": [{ "label": "test", "type": "shell", "command": "pytest -q" },{ "label": "lint", "type": "shell", "command": "ruff check ." },{ "label": "format", "type": "shell", "command": "ruff format ." }]}.vscode/tasks.json
5) Weekly maintenance (5–10 min)# Update tools/deps, run full test suitegit switch main git pull --rebase --all # from local remotes if usedgit gc --prune=now --aggressive # tidy up repogit tag -a v0.1.0 -m "Alpha snapshot" # if you hit a milestonegit push backup --tags --all
6) Collaboration without GitHub (optional)
Local file remote on a shared drive: others add backup as their origin.
Ad-hoc patch exchange:
git format-patch -1 <SHA> # creates .patch filesgit am < 0001-some-change.patchSelf-hosted options (later): Gitea, GitLab CE, or git daemon over LAN.
7) Recovery quick recipes
Undo last commit (keep changes staged):
git reset --soft HEAD~1Discard local changes to a file:
git checkout -- path/to/fileRestore from bundle:
git clone /path/to/myproject-20250817.bundle myproject8) Minimal daily checklist (copy/paste)
git status (clean?)
Pull/rebase from main (if using a shared local remote)
Work on feat/<topic>; commit small, clear messages
Run tests/linters before commit
git push backup HEAD after each logical chunk
End-of-day tag + bundle backup