Repository for all projects (homework, results, final project) for the MEC8200 class. All projets have their own folders for simplicity
- Always
git pull origin mainbefore starting work - Only merge to main when tests pass
- Commit working code, not broken experiments
- Use descriptive branch names:
justin/source-term-unit-testnotjustin/update-test - LLMs are very useful for any git-wise tasks when properly defined in prompt.
git checkout main
git pull origin main # Get latest pushed content from teammates
git checkout -b your-name/feature-name # Create your branch (first time)
# OR
git checkout your-name/feature-name # Switch to existing branch
git merge main # Bring those changes into your work
# Now work on your stuff
git add . # Stage all changed files
# OR
git add path/to/file # Stage specific file
git commit -m "Descriptive message" # Save staged work with clear message
Note You can optimize your commit history by splitting work across multiple task oriented commits. For example if you have changes to both unit tests and core code, you could have a commit only for the unit tests and another for the core changes.
python -m pytest tests/ # Make sure tests pass first
git checkout main
git pull origin main # Get any new changes
git merge your-name/feature-name # Merge your work
git push origin main # Share changes with team
git status # What files changed?
git diff # What exactly changed?git checkout -- filename.py # Undo changes to one file
git reset --hard # Undo ALL uncommitted changes (careful!)git log --oneline # Brief history
git log --graph --oneline --all # Visual branch historygit push origin yourname/feature-name