Engineers track versions with final_v2_FINAL_actuallyFINAL.igs. Git is the professional answer.
Core Concepts
Repository, commit, branch, remote, working tree.
Setting Up Git
git config --global user.name "Alice Chen"
git config --global user.email "alice@example.com"
git config --global core.editor "nano"
git config --list
Starting or Getting a Repo
git init
git clone https://github.com/someuser/somerepo.git
The Basic Workflow
git status
git add script.py
git add .
git add -p
git commit -m "Add boundary condition fix for node 4421"
git push origin main
git pull origin main
Tip: Write commit messages telling what changed and why.
Branches
git branch
git branch new-mesh-refinement
git switch new-mesh-refinement
git checkout -b another-branch
git switch main
git merge new-mesh-refinement
git branch -d new-mesh-refinement
.gitignore
*.pyc
__pycache__/
venv/
*.log
*.out
results/
.DS_Store
Git Worktrees — The Professional Move
When debugging feature-A and need to hotfix main — worktrees are the answer. Same repo, multiple working directories.
git worktree add ../project-feature-a feature-a
cd ../project-feature-a
# work independently
cd ../my-project
# still on main, clean
Manage:
git worktree list
git worktree add -b hotfix ../project-hotfix main
git worktree remove ../project-feature-a
Key takeaway: Worktrees are how AI-augmented workflows stay sane. One worktree for AI generating code, another for reviewing.
Resolving Conflicts
<<<<<<< HEAD
boundary_pressure = 101325.0
=======
boundary_pressure = 101000.0
>>>>>>> hotfix-branch
Edit, then git add and git commit.
Viewing History
git log
git log --oneline
git log --oneline --graph
git log -p script.py
git diff
git diff --staged
git show abc1234
Try It Yourself
Create a test repo, add a worktree for a feature branch, make changes in the worktree, verify main is untouched, merge, and clean up the worktree.
Quiz
What is the primary advantage of git worktree over a second clone?
Answer
B) They share the same Git history and object database — no duplication.